mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 03:01:09 +02:00
net: remove orphaned CSubNet::SanityCheck()
CSubNet::SanityCheck() was added in #20140, and not removed in #22570 when it became orphaned code.
This commit is contained in:
@ -1106,29 +1106,6 @@ bool CSubNet::IsValid() const
|
|||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSubNet::SanityCheck() const
|
|
||||||
{
|
|
||||||
switch (network.m_net) {
|
|
||||||
case NET_IPV4:
|
|
||||||
case NET_IPV6:
|
|
||||||
break;
|
|
||||||
case NET_ONION:
|
|
||||||
case NET_I2P:
|
|
||||||
case NET_CJDNS:
|
|
||||||
return true;
|
|
||||||
case NET_INTERNAL:
|
|
||||||
case NET_UNROUTABLE:
|
|
||||||
case NET_MAX:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t x = 0; x < network.m_addr.size(); ++x) {
|
|
||||||
if (network.m_addr[x] & ~netmask[x]) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(const CSubNet& a, const CSubNet& b)
|
bool operator==(const CSubNet& a, const CSubNet& b)
|
||||||
{
|
{
|
||||||
return a.valid == b.valid && a.network == b.network && !memcmp(a.netmask, b.netmask, 16);
|
return a.valid == b.valid && a.network == b.network && !memcmp(a.netmask, b.netmask, 16);
|
||||||
|
@ -476,8 +476,6 @@ protected:
|
|||||||
/// Is this value valid? (only used to signal parse errors)
|
/// Is this value valid? (only used to signal parse errors)
|
||||||
bool valid;
|
bool valid;
|
||||||
|
|
||||||
bool SanityCheck() const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Construct an invalid subnet (empty, `Match()` always returns false).
|
* Construct an invalid subnet (empty, `Match()` always returns false).
|
||||||
|
Reference in New Issue
Block a user