Skip to content

Commit

Permalink
Fix array indexing in get_neighbours (ton-blockchain#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese authored Sep 27, 2022
1 parent 5c2ad4a commit 7d810da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion overlay/overlay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class OverlayImpl : public Overlay {
} else {
std::vector<adnl::AdnlNodeIdShort> vec;
for (td::uint32 i = 0; i < max_size; i++) {
vec.push_back(neighbours_[td::Random::fast(0, static_cast<td::int32>(neighbours_.size()))]);
vec.push_back(neighbours_[td::Random::fast(0, static_cast<td::int32>(neighbours_.size()) - 1)]);
}
return vec;
}
Expand Down

0 comments on commit 7d810da

Please sign in to comment.