Skip to content

Commit bc35c4f

Browse files
committed
Merge bitcoin/bitcoin#27106: net: remove orphaned CSubNet::SanityCheck()
30a3230 script: remove out-of-date snprintf TODO (Jon Atack) 0e01514 net: remove orphaned CSubNet::SanityCheck() (Jon Atack) Pull request description: `CSubNet::SanityCheck()` was added in #20140, and not removed in #22570 when it became orphaned code. Also, remove an out-of-date `snprintf` TODO that was resolved in #27036, and fix up 2 words to make the spelling linter green again. ACKs for top commit: fanquake: ACK 30a3230 pinheadmz: ACK 30a3230 brunoerg: crACK 30a3230 Tree-SHA512: f91a2a5af902d3b82ab496f19deeac17d58dbf72a8016e880ea61ad858b66e7ea0ae70b964c4032018eb3252cc34ac5fea163131c6a7f1baf87fc9ec9b5833d8
2 parents 73966f7 + 30a3230 commit bc35c4f

File tree

5 files changed

+2
-29
lines changed

5 files changed

+2
-29
lines changed

src/blockencodings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class PartiallyDownloadedBlock {
135135
public:
136136
CBlockHeader header;
137137

138-
// Can be overriden for testing
138+
// Can be overridden for testing
139139
using CheckBlockFn = std::function<bool(const CBlock&, BlockValidationState&, const Consensus::Params&, bool, bool)>;
140140
CheckBlockFn m_check_block_mock{nullptr};
141141

src/net.cpp

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

src/netaddress.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,29 +1106,6 @@ bool CSubNet::IsValid() const
11061106
return valid;
11071107
}
11081108

1109-
bool CSubNet::SanityCheck() const
1110-
{
1111-
switch (network.m_net) {
1112-
case NET_IPV4:
1113-
case NET_IPV6:
1114-
break;
1115-
case NET_ONION:
1116-
case NET_I2P:
1117-
case NET_CJDNS:
1118-
return true;
1119-
case NET_INTERNAL:
1120-
case NET_UNROUTABLE:
1121-
case NET_MAX:
1122-
return false;
1123-
}
1124-
1125-
for (size_t x = 0; x < network.m_addr.size(); ++x) {
1126-
if (network.m_addr[x] & ~netmask[x]) return false;
1127-
}
1128-
1129-
return true;
1130-
}
1131-
11321109
bool operator==(const CSubNet& a, const CSubNet& b)
11331110
{
11341111
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
@@ -476,8 +476,6 @@ class CSubNet
476476
/// Is this value valid? (only used to signal parse errors)
477477
bool valid;
478478

479-
bool SanityCheck() const;
480-
481479
public:
482480
/**
483481
* Construct an invalid subnet (empty, `Match()` always returns false).

test/lint/lint-locale-dependence.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#
3535
# See https://doc.qt.io/qt-5/qcoreapplication.html#locale-settings and
3636
# https://stackoverflow.com/a/34878283 for more details.
37-
#
38-
# TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent snprintf with strprintf.
3937

4038
import re
4139
import sys

0 commit comments

Comments
 (0)