diff --git a/core/network/impl/synchronizer_impl.cpp b/core/network/impl/synchronizer_impl.cpp index 8a0c1926ad..d2c569fa2c 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, - PeerState &peer_state) { - if (peer_state.best_block >= block_info) { - active_peers.push_back(peer_id); + [&active_peers, &block_info, &peer_id](const PeerId &p_id, + PeerState &peer_state) { + if (peer_state.best_block >= block_info and p_id != peer_id) { + active_peers.push_back(p_id); } return true; });