aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r--src/addrman.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index eb431ec59c..5d9527f0e1 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -332,14 +332,13 @@ void CAddrMan::Attempt_(const CService& addr, int64_t nTime)
info.nAttempts++;
}
-CAddress CAddrMan::Select_(int nUnkBias)
+CAddress CAddrMan::Select_()
{
if (size() == 0)
return CAddress();
- double nCorTried = sqrt(nTried) * (100.0 - nUnkBias);
- double nCorNew = sqrt(nNew) * nUnkBias;
- if ((nCorTried + nCorNew) * GetRandInt(1 << 30) / (1 << 30) < nCorTried) {
+ // Use a 50% chance for choosing between tried and new table entries.
+ if (nTried > 0 && (nNew == 0 || GetRandInt(2) == 0)) {
// use a tried node
double fChanceFactor = 1.0;
while (1) {