aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-04-16 12:46:34 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-04-16 12:46:34 -0500
commit7cf47d754c58e65a3c8fa52690208014328a083f (patch)
treec56842e3a7b7f1207c1f6559adc752d850fc0299 /src
parentMerge pull request #7136 (diff)
parentp2p: fix cubic selection in filtered peer list (diff)
downloadmonero-7cf47d754c58e65a3c8fa52690208014328a083f.tar.xz
Merge pull request #7258
1d1c430 p2p: fix cubic selection in filtered peer list (moneromooo)
Diffstat (limited to 'src')
-rw-r--r--src/p2p/net_node.inl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 4c8e721ba..e1d6d1e10 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -1229,8 +1229,8 @@ namespace nodetool
if(!max_index)
return 0;
- size_t x = crypto::rand<size_t>()%(max_index+1);
- size_t res = (x*x*x)/(max_index*max_index); //parabola \/
+ size_t x = crypto::rand<size_t>()%(16*max_index+1);
+ size_t res = (x*x*x)/(max_index*max_index*16*16*16); //parabola \/
MDEBUG("Random connection index=" << res << "(x="<< x << ", max_index=" << max_index << ")");
return res;
}