1
0
Fork 0
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:
SpyCheese 2024-08-12 10:07:15 +03:00
parent c740b098e2
commit e7da7a5580

View file

@ -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]);