mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Adding CSubNet constructor over a single CNetAddr
This commit is contained in:
@@ -1291,6 +1291,13 @@ CSubNet::CSubNet(const std::string &strSubnet, bool fAllowLookup)
|
||||
network.ip[x] &= netmask[x];
|
||||
}
|
||||
|
||||
CSubNet::CSubNet(const CNetAddr &addr):
|
||||
valid(addr.IsValid())
|
||||
{
|
||||
memset(netmask, 255, sizeof(netmask));
|
||||
network = addr;
|
||||
}
|
||||
|
||||
bool CSubNet::Match(const CNetAddr &addr) const
|
||||
{
|
||||
if (!valid || !addr.IsValid())
|
||||
|
||||
Reference in New Issue
Block a user