Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#30445: test: addrman: tried 3 times and never a success…
… so `isTerrible=true` 1807df3 test: 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-ACK 1807df3 naumenkogs: ACK 1807df3 achow101: ACK 1807df3 Tree-SHA512: e3cc43c98bddfe90f585d5b4bd00543be443b77ecaf038615261aa8cc4d14fc2f1006d0b00c04188040eaace455c5c6dbb3bb200a2c0f29c3b4ef5128bf0973a
- Loading branch information