aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <[email protected]>2016-01-15 05:17:15 +0000
committerLuke Dashjr <[email protected]>2016-01-15 05:17:15 +0000
commit5bc4fb7b602c420be1c746442edad6b2d8e333ab (patch)
tree32ce1458f7fafdf4f9a1dcb09091f1a6de416625 /src/addrman.cpp
parentbanlist (bugfix): allow CNode::SweepBanned() to run on interval (diff)
parentMerge pull request #7327 (diff)
downloaddiscoin-5bc4fb7b602c420be1c746442edad6b2d8e333ab.tar.xz
discoin-5bc4fb7b602c420be1c746442edad6b2d8e333ab.zip
Merge branch 'master' into 20150703_banlist_updates
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r--src/addrman.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index ff1f7e918..078b9e168 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -329,13 +329,17 @@ void CAddrMan::Attempt_(const CService& addr, int64_t nTime)
info.nAttempts++;
}
-CAddrInfo CAddrMan::Select_()
+CAddrInfo CAddrMan::Select_(bool newOnly)
{
if (size() == 0)
return CAddrInfo();
+ if (newOnly && nNew == 0)
+ return CAddrInfo();
+
// Use a 50% chance for choosing between tried and new table entries.
- if (nTried > 0 && (nNew == 0 || GetRandInt(2) == 0)) {
+ if (!newOnly &&
+ (nTried > 0 && (nNew == 0 || GetRandInt(2) == 0))) {
// use a tried node
double fChanceFactor = 1.0;
while (1) {