Skip to content

Commit

Permalink
Fix adding overlay neighbor (ton-blockchain#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese authored Aug 23, 2024
1 parent 1af2d37 commit cba9277
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions overlay/overlay-peers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ void OverlayImpl::add_peer(OverlayNode node) {
peer_list_.peers_.insert(id, OverlayPeer(std::move(node)));
del_some_peers();
auto X = peer_list_.peers_.get(id);
CHECK(X);

if (peer_list_.neighbours_.size() < max_neighbours() &&
if (X != nullptr && peer_list_.neighbours_.size() < max_neighbours() &&
!(X->get_node()->flags() & OverlayMemberFlags::DoNotReceiveBroadcasts) && X->get_id() != local_id_) {
peer_list_.neighbours_.push_back(X->get_id());
X->set_neighbour(true);
Expand Down

0 comments on commit cba9277

Please sign in to comment.