mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #2282
7fdc178a
p2p: fix random peer index being too large (moneromooo-monero)
This commit is contained in:
commit
4bfb58328d
1 changed files with 2 additions and 0 deletions
|
@ -1126,6 +1126,8 @@ namespace nodetool
|
||||||
size_t random_index;
|
size_t random_index;
|
||||||
|
|
||||||
if (use_white_list) {
|
if (use_white_list) {
|
||||||
|
local_peers_count = m_peerlist.get_white_peers_count();
|
||||||
|
max_random_index = std::min<uint64_t>(local_peers_count -1, 20);
|
||||||
random_index = get_random_index_with_fixed_probability(max_random_index);
|
random_index = get_random_index_with_fixed_probability(max_random_index);
|
||||||
} else {
|
} else {
|
||||||
random_index = crypto::rand<size_t>() % m_peerlist.get_gray_peers_count();
|
random_index = crypto::rand<size_t>() % m_peerlist.get_gray_peers_count();
|
||||||
|
|
Loading…
Reference in a new issue