Skip to content

Commit

Permalink
Check for peer id while iteratring over peer states
Browse files Browse the repository at this point in the history
  • Loading branch information
ErakhtinB committed Dec 27, 2024
1 parent 9604a31 commit ab41109
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/network/impl/synchronizer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ namespace kagome::network {
std::vector<libp2p::peer::PeerId> selected_peers = {peer_id};
std::vector<libp2p::peer::PeerId> 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;
});
Expand Down

0 comments on commit ab41109

Please sign in to comment.