Skip to content

Commit 57b0c0a

Browse files
committed
Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater
1 parent 8ef15e8 commit 57b0c0a

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/net.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,11 +2505,6 @@ CConnman::~CConnman()
25052505
Stop();
25062506
}
25072507

2508-
size_t CConnman::GetAddressCount() const
2509-
{
2510-
return addrman.size();
2511-
}
2512-
25132508
void CConnman::SetServices(const CService &addr, ServiceFlags nServices)
25142509
{
25152510
addrman.SetServices(addr, nServices);

src/net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ class CConnman
247247
};
248248

249249
// Addrman functions
250-
size_t GetAddressCount() const;
251250
void SetServices(const CService &addr, ServiceFlags nServices);
252251
void MarkAddressGood(const CAddress& addr);
253252
void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0);

src/net_processing.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman&
14401440
assert(nRelayNodes <= best.size());
14411441

14421442
auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {
1443-
if (pnode->nVersion >= CADDR_TIME_VERSION && pnode->IsAddrRelayPeer()) {
1443+
if (pnode->IsAddrRelayPeer()) {
14441444
uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize();
14451445
for (unsigned int i = 0; i < nRelayNodes; i++) {
14461446
if (hashKey > best[i].first) {
@@ -2351,11 +2351,8 @@ void ProcessMessage(
23512351
}
23522352

23532353
// Get recent addresses
2354-
if (pfrom.fOneShot || pfrom.nVersion >= CADDR_TIME_VERSION || connman->GetAddressCount() < 1000)
2355-
{
2356-
connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));
2357-
pfrom.fGetAddr = true;
2358-
}
2354+
connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));
2355+
pfrom.fGetAddr = true;
23592356
connman->MarkAddressGood(pfrom.addr);
23602357
}
23612358

@@ -2445,9 +2442,6 @@ void ProcessMessage(
24452442
std::vector<CAddress> vAddr;
24462443
vRecv >> vAddr;
24472444

2448-
// Don't want addr from older versions unless seeding
2449-
if (pfrom.nVersion < CADDR_TIME_VERSION && connman->GetAddressCount() > 1000)
2450-
return;
24512445
if (!pfrom.IsAddrRelayPeer()) {
24522446
return;
24532447
}

0 commit comments

Comments
 (0)