Skip to content

Commit 8888bd4

Browse files
author
MarcoFalke
committed
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.
1 parent 00001e5 commit 8888bd4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/addrman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ int AddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int nBucket) con
6666

6767
bool AddrInfo::IsTerrible(int64_t nNow) const
6868
{
69-
if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute
69+
if (nNow - nLastTry <= 60) { // never remove things tried in the last minute
7070
return false;
71+
}
7172

7273
if (nTime > nNow + 10 * 60) // came in a flying DeLorean
7374
return true;

0 commit comments

Comments
 (0)