Skip to content

Commit

Permalink
Mempool syncer: check peer for necessary service flag when adding it …
Browse files Browse the repository at this point in the history
…dynamically
  • Loading branch information
Eligioo committed Nov 7, 2024
1 parent 918a0a3 commit 0b03d91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mempool/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use nimiq_consensus::{sync::syncer::SyncEvent, ConsensusProxy};
use nimiq_hash::{Blake2bHash, Hash};
use nimiq_network_interface::{
network::Network,
peer_info::Services,
request::{request_handler, RequestError},
};
use nimiq_time::sleep_until;
Expand Down Expand Up @@ -193,7 +194,11 @@ impl<N: Network> MempoolSyncer<N> {

/// Add peer to discover its mempool
fn add_peer(&mut self, peer_id: N::PeerId) {
if self.peers.contains(&peer_id) {
if self.peers.contains(&peer_id)
|| !self
.network
.peer_provides_services(peer_id, Services::MEMPOOL)
{
return;
}

Expand Down

0 comments on commit 0b03d91

Please sign in to comment.