From a3b9c38469adc9b3e893ce2c47c3d961546f783a Mon Sep 17 00:00:00 2001 From: Boris Erakhtin Date: Fri, 27 Dec 2024 19:42:10 +0500 Subject: [PATCH] Check for peer id while iteratring over peer states --- core/network/impl/synchronizer_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/network/impl/synchronizer_impl.cpp b/core/network/impl/synchronizer_impl.cpp index 8a0c1926ad..8141bac4d2 100644 --- a/core/network/impl/synchronizer_impl.cpp +++ b/core/network/impl/synchronizer_impl.cpp @@ -333,10 +333,10 @@ namespace kagome::network { std::vector selected_peers = {peer_id}; std::vector active_peers; peer_manager_->enumeratePeerState( - [&active_peers, &block_info](const PeerId &peer_id, + [&active_peers, &block_info, &peer_id](const PeerId &p_id, PeerState &peer_state) { - if (peer_state.best_block >= block_info) { - active_peers.push_back(peer_id); + if (peer_state.best_block >= block_info and p_id != peer_id) { + active_peers.push_back(p_id); } return true; });