Skip to content

Commit

Permalink
Implement issue #997 to reduce time for test_bitcoin due to sleeps in
Browse files Browse the repository at this point in the history
addrman.  Related to issue #717.
  • Loading branch information
bitcartel committed Jun 6, 2016
1 parent 0dd2bf9 commit edab3dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
nKBucketPos = (nKBucketPos + insecure_rand()) % ADDRMAN_BUCKET_SIZE;
if (i++ > kMaxRetries)
return CAddrInfo();
if (i % kRetriesBetweenSleep == 0)
if (i % kRetriesBetweenSleep == 0 && !nKey.IsNull())
MilliSleep(kRetrySleepInterval);
}
int nId = vvTried[nKBucket][nKBucketPos];
Expand All @@ -378,7 +378,7 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
nUBucketPos = (nUBucketPos + insecure_rand()) % ADDRMAN_BUCKET_SIZE;
if (i++ > kMaxRetries)
return CAddrInfo();
if (i % kRetriesBetweenSleep == 0)
if (i % kRetriesBetweenSleep == 0 && !nKey.IsNull())
MilliSleep(kRetrySleepInterval);
}
int nId = vvNew[nUBucket][nUBucketPos];
Expand Down

0 comments on commit edab3dd

Please sign in to comment.