From 8888bd43c100f9f0ca1122fcc896fb7b999d61c6 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 11 Apr 2022 14:24:47 +0200 Subject: 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. --- src/addrman.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/addrman.cpp') 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; -- cgit v1.2.3