mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
OverlayImpl::get_neighbours bugfix
This commit is contained in:
parent
c740b098e2
commit
e7da7a5580
1 changed files with 2 additions and 4 deletions
|
@ -624,10 +624,8 @@ std::vector<adnl::AdnlNodeIdShort> OverlayImpl::get_neighbours(td::uint32 max_si
|
|||
for (td::uint32 i = 0; i < max_size; i++) {
|
||||
td::uint32 t = td::Random::fast(0, static_cast<td::int32>(peer_list_.neighbours_.size()) - 1 - i);
|
||||
td::uint32 j;
|
||||
for (j = 0; j < i; j++) {
|
||||
if (ul[j] <= t) {
|
||||
t++;
|
||||
}
|
||||
for (j = 0; j < i && ul[j] <= t; j++) {
|
||||
t++;
|
||||
}
|
||||
ul.emplace(ul.begin() + j, t);
|
||||
vec.push_back(peer_list_.neighbours_[t]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue