mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-15 04:30:42 +02:00
Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater
This commit is contained in:
parent
8ef15e8a86
commit
57b0c0a93a
@ -2505,11 +2505,6 @@ CConnman::~CConnman()
|
|||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CConnman::GetAddressCount() const
|
|
||||||
{
|
|
||||||
return addrman.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CConnman::SetServices(const CService &addr, ServiceFlags nServices)
|
void CConnman::SetServices(const CService &addr, ServiceFlags nServices)
|
||||||
{
|
{
|
||||||
addrman.SetServices(addr, nServices);
|
addrman.SetServices(addr, nServices);
|
||||||
|
@ -247,7 +247,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Addrman functions
|
// Addrman functions
|
||||||
size_t GetAddressCount() const;
|
|
||||||
void SetServices(const CService &addr, ServiceFlags nServices);
|
void SetServices(const CService &addr, ServiceFlags nServices);
|
||||||
void MarkAddressGood(const CAddress& addr);
|
void MarkAddressGood(const CAddress& addr);
|
||||||
void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0);
|
void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0);
|
||||||
|
@ -1440,7 +1440,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman&
|
|||||||
assert(nRelayNodes <= best.size());
|
assert(nRelayNodes <= best.size());
|
||||||
|
|
||||||
auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {
|
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();
|
uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize();
|
||||||
for (unsigned int i = 0; i < nRelayNodes; i++) {
|
for (unsigned int i = 0; i < nRelayNodes; i++) {
|
||||||
if (hashKey > best[i].first) {
|
if (hashKey > best[i].first) {
|
||||||
@ -2351,11 +2351,8 @@ void ProcessMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get recent addresses
|
// Get recent addresses
|
||||||
if (pfrom.fOneShot || pfrom.nVersion >= CADDR_TIME_VERSION || connman->GetAddressCount() < 1000)
|
|
||||||
{
|
|
||||||
connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));
|
connman->PushMessage(&pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));
|
||||||
pfrom.fGetAddr = true;
|
pfrom.fGetAddr = true;
|
||||||
}
|
|
||||||
connman->MarkAddressGood(pfrom.addr);
|
connman->MarkAddressGood(pfrom.addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2445,9 +2442,6 @@ void ProcessMessage(
|
|||||||
std::vector<CAddress> vAddr;
|
std::vector<CAddress> vAddr;
|
||||||
vRecv >> 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()) {
|
if (!pfrom.IsAddrRelayPeer()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user