mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
Merge pull request #7258
1d1c430
p2p: fix cubic selection in filtered peer list (moneromooo)
This commit is contained in:
commit
7cf47d754c
@ -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 New Issue
Block a user