mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Make AddrMan support multiple ports per IP
This commit is contained in:
@@ -401,7 +401,7 @@ void AddrManImpl::Unserialize(Stream& s_)
|
||||
}
|
||||
}
|
||||
|
||||
AddrInfo* AddrManImpl::Find(const CNetAddr& addr, int* pnId)
|
||||
AddrInfo* AddrManImpl::Find(const CService& addr, int* pnId)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
@@ -556,10 +556,6 @@ void AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nT
|
||||
|
||||
AddrInfo& info = *pinfo;
|
||||
|
||||
// check whether we are talking about the exact same CService (including same port)
|
||||
if (info != addr)
|
||||
return;
|
||||
|
||||
// update info
|
||||
info.nLastSuccess = nTime;
|
||||
info.nLastTry = nTime;
|
||||
@@ -683,10 +679,6 @@ void AddrManImpl::Attempt_(const CService& addr, bool fCountFailure, int64_t nTi
|
||||
|
||||
AddrInfo& info = *pinfo;
|
||||
|
||||
// check whether we are talking about the exact same CService (including same port)
|
||||
if (info != addr)
|
||||
return;
|
||||
|
||||
// update info
|
||||
info.nLastTry = nTime;
|
||||
if (fCountFailure && info.nLastCountAttempt < nLastGood) {
|
||||
@@ -796,10 +788,6 @@ void AddrManImpl::Connected_(const CService& addr, int64_t nTime)
|
||||
|
||||
AddrInfo& info = *pinfo;
|
||||
|
||||
// check whether we are talking about the exact same CService (including same port)
|
||||
if (info != addr)
|
||||
return;
|
||||
|
||||
// update info
|
||||
int64_t nUpdateInterval = 20 * 60;
|
||||
if (nTime - info.nTime > nUpdateInterval)
|
||||
@@ -818,10 +806,6 @@ void AddrManImpl::SetServices_(const CService& addr, ServiceFlags nServices)
|
||||
|
||||
AddrInfo& info = *pinfo;
|
||||
|
||||
// check whether we are talking about the exact same CService (including same port)
|
||||
if (info != addr)
|
||||
return;
|
||||
|
||||
// update info
|
||||
info.nServices = nServices;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user