Skip to content

Commit 01975fb

Browse files
committed
partial bitcoin#27106: remove orphaned CSubNet::SanityCheck()
excludes: - 30a3230 (spelling correction in `src/blockencodings.h`)
1 parent 1e18146 commit 01975fb

File tree

4 files changed

+1
-27
lines changed

4 files changed

+1
-27
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3305,7 +3305,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, CDe
33053305
// Therefore, we do not add them to addrman in the first place.
33063306
// In case previously unreachable networks become reachable
33073307
// (e.g. in case of -onlynet changes by the user), fixed seeds will
3308-
// be loaded only for networks for which we have no addressses.
3308+
// be loaded only for networks for which we have no addresses.
33093309
seed_addrs.erase(std::remove_if(seed_addrs.begin(), seed_addrs.end(),
33103310
[&fixed_seed_networks](const CAddress& addr) { return fixed_seed_networks.count(addr.GetNetwork()) == 0; }),
33113311
seed_addrs.end());

src/netaddress.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,29 +1100,6 @@ bool CSubNet::IsValid() const
11001100
return valid;
11011101
}
11021102

1103-
bool CSubNet::SanityCheck() const
1104-
{
1105-
switch (network.m_net) {
1106-
case NET_IPV4:
1107-
case NET_IPV6:
1108-
break;
1109-
case NET_ONION:
1110-
case NET_I2P:
1111-
case NET_CJDNS:
1112-
return true;
1113-
case NET_INTERNAL:
1114-
case NET_UNROUTABLE:
1115-
case NET_MAX:
1116-
return false;
1117-
}
1118-
1119-
for (size_t x = 0; x < network.m_addr.size(); ++x) {
1120-
if (network.m_addr[x] & ~netmask[x]) return false;
1121-
}
1122-
1123-
return true;
1124-
}
1125-
11261103
bool operator==(const CSubNet& a, const CSubNet& b)
11271104
{
11281105
return a.valid == b.valid && a.network == b.network && !memcmp(a.netmask, b.netmask, 16);

src/netaddress.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ class CSubNet
485485
/// Is this value valid? (only used to signal parse errors)
486486
bool valid;
487487

488-
bool SanityCheck() const;
489-
490488
public:
491489
/**
492490
* Construct an invalid subnet (empty, `Match()` always returns false).

test/lint/lint-locale-dependence.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#
3838
# TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent stoul/strtol with locale
3939
# independent ToIntegral<T>(...).
40-
# TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent snprintf with strprintf.
4140

4241
import re
4342
import sys

0 commit comments

Comments
 (0)