Skip to content

Commit c0b0b02

Browse files
author
MarcoFalke
committed
Merge #14033: p2p: Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater
57b0c0a Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater (Ben Woosley) Pull request description: We do not connect to peers older than 31800 ACKs for top commit: sipa: Code reivew ACK 57b0c0a jnewbery: Code review ACK 57b0c0a vasild: ACK 57b0c0a Tree-SHA512: e1ca7c9203cbad83ab7c7a2312777ad07ed6a16119169b256648b8a8738c260a5168acdd4fb33f6e4b17f51ec7e033e110b76bde55b4e3b2d444dc02c01bc2b1
2 parents 107b855 + 57b0c0a commit c0b0b02

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
@@ -2511,11 +2511,6 @@ CConnman::~CConnman()
25112511
Stop();
25122512
}
25132513

2514-
size_t CConnman::GetAddressCount() const
2515-
{
2516-
return addrman.size();
2517-
}
2518-
25192514
void CConnman::SetServices(const CService &addr, ServiceFlags nServices)
25202515
{
25212516
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
@@ -1438,7 +1438,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman&
14381438
assert(nRelayNodes <= best.size());
14391439

14401440
auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {
1441-
if (pnode->nVersion >= CADDR_TIME_VERSION && pnode->IsAddrRelayPeer()) {
1441+
if (pnode->IsAddrRelayPeer()) {
14421442
uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize();
14431443
for (unsigned int i = 0; i < nRelayNodes; i++) {
14441444
if (hashKey > best[i].first) {
@@ -2349,11 +2349,8 @@ void ProcessMessage(
23492349
}
23502350

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

@@ -2443,9 +2440,6 @@ void ProcessMessage(
24432440
std::vector<CAddress> vAddr;
24442441
vRecv >> vAddr;
24452442

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

0 commit comments

Comments
 (0)