diff options
| author | Jonas Schnelli <[email protected]> | 2015-06-29 20:37:22 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2015-07-02 20:44:27 +0200 |
| commit | 177a0e491449b9accfa0cf17c138147539071358 (patch) | |
| tree | 163b252ea7c7204017187f1e0e32ce12831fb7f0 /src/netbase.cpp | |
| parent | use CBanEntry as object container for banned nodes (diff) | |
| download | discoin-177a0e491449b9accfa0cf17c138147539071358.tar.xz discoin-177a0e491449b9accfa0cf17c138147539071358.zip | |
Adding CSubNet constructor over a single CNetAddr
Diffstat (limited to 'src/netbase.cpp')
| -rw-r--r-- | src/netbase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index adac5c2d0..c9fc7d67f 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -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()) |