diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-04-11 14:24:47 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-08 13:35:32 +0200 |
commit | 8888bd43c100f9f0ca1122fcc896fb7b999d61c6 (patch) | |
tree | 0f095cb2a5f99e2a2806a3ff90dd4364652c59c5 | |
parent | 00001e57fe74c061aa9cbc72b07252335cb566e0 (diff) | |
download | bitcoin-8888bd43c100f9f0ca1122fcc896fb7b999d61c6.tar.xz |
Remove redundant nLastTry check
All other places calculate "now - nLastTry", which is safe and correct
to do when nLastTry is 0. So do the same here.
-rw-r--r-- | src/addrman.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index 678396993b..204bb544c5 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -66,8 +66,9 @@ int AddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int nBucket) con bool AddrInfo::IsTerrible(int64_t nNow) const { - if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute + if (nNow - nLastTry <= 60) { // never remove things tried in the last minute return false; + } if (nTime > nNow + 10 * 60) // came in a flying DeLorean return true; |