From 57b0c0a93a243769beb306c89560d1eda61f54bd Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Thu, 23 Aug 2018 10:02:49 -0700 Subject: [PATCH] Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater --- src/net.cpp | 5 ----- src/net.h | 1 - src/net_processing.cpp | 12 +++--------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 371fbeed593..ddf7d717fb8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2505,11 +2505,6 @@ CConnman::~CConnman() Stop(); } -size_t CConnman::GetAddressCount() const -{ - return addrman.size(); -} - void CConnman::SetServices(const CService &addr, ServiceFlags nServices) { addrman.SetServices(addr, nServices); diff --git a/src/net.h b/src/net.h index b461470f1fc..c010d939ea8 100644 --- a/src/net.h +++ b/src/net.h @@ -247,7 +247,6 @@ public: }; // Addrman functions - size_t GetAddressCount() const; void SetServices(const CService &addr, ServiceFlags nServices); void MarkAddressGood(const CAddress& addr); void AddNewAddresses(const std::vector& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 270e415e420..5c14d88525c 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1440,7 +1440,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman& assert(nRelayNodes <= best.size()); auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) { - if (pnode->nVersion >= CADDR_TIME_VERSION && pnode->IsAddrRelayPeer()) { + if (pnode->IsAddrRelayPeer()) { uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize(); for (unsigned int i = 0; i < nRelayNodes; i++) { if (hashKey > best[i].first) { @@ -2351,11 +2351,8 @@ void ProcessMessage( } // Get recent addresses - if (pfrom.fOneShot || pfrom.nVersion >= CADDR_TIME_VERSION || connman->GetAddressCount() < 1000) - { - connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR)); - pfrom.fGetAddr = true; - } + connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR)); + pfrom.fGetAddr = true; connman->MarkAddressGood(pfrom.addr); } @@ -2445,9 +2442,6 @@ void ProcessMessage( std::vector vAddr; vRecv >> vAddr; - // Don't want addr from older versions unless seeding - if (pfrom.nVersion < CADDR_TIME_VERSION && connman->GetAddressCount() > 1000) - return; if (!pfrom.IsAddrRelayPeer()) { return; }