mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
Merge pull request #7258
1d1c430
p2p: fix cubic selection in filtered peer list (moneromooo)
This commit is contained in:
commit
7cf47d754c
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue