reth_network_p2p/download.rs
1use reth_network_peers::PeerId;
2use std::fmt::Debug;
3
4/// Generic download client for peer penalization
5#[auto_impl::auto_impl(&, Arc, Box)]
6pub trait DownloadClient: Send + Sync + Debug {
7 /// Penalize the peer for responding with a message
8 /// that violates validation rules
9 fn report_bad_message(&self, peer_id: PeerId);
10
11 /// Returns how many peers the network is currently connected to.
12 fn num_connected_peers(&self) -> usize;
13}