mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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.
This commit is contained in:
@@ -66,8 +66,9 @@ int AddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int nBucket) con
|
|||||||
|
|
||||||
bool AddrInfo::IsTerrible(int64_t nNow) const
|
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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (nTime > nNow + 10 * 60) // came in a flying DeLorean
|
if (nTime > nNow + 10 * 60) // came in a flying DeLorean
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user