mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Adding CSubNet constructor over a single CNetAddr
This commit is contained in:
@@ -488,7 +488,7 @@ bool CNode::IsBanned(CSubNet subnet)
|
||||
}
|
||||
|
||||
void CNode::Ban(const CNetAddr& addr, const BanReason &banReason, int64_t bantimeoffset, bool sinceUnixEpoch) {
|
||||
CSubNet subNet(addr.ToString()+(addr.IsIPv4() ? "/32" : "/128"));
|
||||
CSubNet subNet(addr);
|
||||
Ban(subNet, banReason, bantimeoffset, sinceUnixEpoch);
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ void CNode::Ban(const CSubNet& subNet, const BanReason &banReason, int64_t banti
|
||||
}
|
||||
|
||||
bool CNode::Unban(const CNetAddr &addr) {
|
||||
CSubNet subNet(addr.ToString()+(addr.IsIPv4() ? "/32" : "/128"));
|
||||
CSubNet subNet(addr);
|
||||
return Unban(subNet);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user