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 a3b9c38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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,
[&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;
});
Expand Down

0 comments on commit a3b9c38

Please sign in to comment.