reth_network_p2p/
download.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
use reth_network_peers::PeerId;
use std::fmt::Debug;

/// Generic download client for peer penalization
#[auto_impl::auto_impl(&, Arc, Box)]
pub trait DownloadClient: Send + Sync + Debug {
    /// Penalize the peer for responding with a message
    /// that violates validation rules
    fn report_bad_message(&self, peer_id: PeerId);

    /// Returns how many peers the network is currently connected to.
    fn num_connected_peers(&self) -> usize;
}