mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-16 10:37:21 +02:00
1807df3d9ftest: addrman: tried 3 times and never a success so `isTerrible=true` (brunoerg) Pull request description: This PR adds test coverage for the following verification: ```cpp if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success return true; } ``` If we've tried an address for 3 or more times and were unsuccessful, this address should be pointed out as "terrible". ------- You can test this by applying: ```diff diff --git a/src/addrman.cpp b/src/addrman.cpp index 054a9bee32..93a9521b59 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -81,7 +81,7 @@ bool AddrInfo::IsTerrible(NodeSeconds now) const } if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success - return true; + return false; } ``` ACKs for top commit: jonatack: re-ACK1807df3d9fnaumenkogs: ACK1807df3d9fachow101: ACK1807df3d9fTree-SHA512: e3cc43c98bddfe90f585d5b4bd00543be443b77ecaf038615261aa8cc4d14fc2f1006d0b00c04188040eaace455c5c6dbb3bb200a2c0f29c3b4ef5128bf0973a