mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
[addrman] Ensure collisions eventually get resolved
After 40 minutes, time out a test-before-evict entry and just evict without
testing. Otherwise, if we were unable to test an entry for some reason, we
might break using feelers altogether.
Github-Pull: #15486
Rebased-From: f71fdda3bc
Tree-SHA512: 66c61a9f030b1666e98e4fe66dd6cfc5f1d03b2a1ec01567b195903db6e4412ac778f4464ee9ef35ae6faa1ab7e4b18ef7ecb9a7ced29e6494046990aebf7b76
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
487f0c3dc9
commit
333be7aabf
@@ -569,6 +569,13 @@ void CAddrMan::ResolveCollisions_()
|
||||
Good_(info_new, false, GetAdjustedTime());
|
||||
erase_collision = true;
|
||||
}
|
||||
} else if (GetAdjustedTime() - info_new.nLastSuccess > ADDRMAN_TEST_WINDOW) {
|
||||
// If the collision hasn't resolved in some reasonable amount of time,
|
||||
// just evict the old entry -- we must not be able to
|
||||
// connect to it for some reason.
|
||||
LogPrint(BCLog::ADDRMAN, "Unable to test; swapping %s for %s in tried table anyway\n", info_new.ToString(), info_old.ToString());
|
||||
Good_(info_new, false, GetAdjustedTime());
|
||||
erase_collision = true;
|
||||
}
|
||||
} else { // Collision is not actually a collision anymore
|
||||
Good_(info_new, false, GetAdjustedTime());
|
||||
|
||||
Reference in New Issue
Block a user