Outbound

Trait Outbound 

Source
pub trait Outbound<N: Network> {
    // Required methods
    fn router(&self) -> &Router<N>;
    fn is_block_synced(&self) -> bool;
    fn num_blocks_behind(&self) -> Option<u32>;

    // Provided methods
    fn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr]) { ... }
    fn propagate_to_validators(
        &self,
        message: Message<N>,
        excluded_peers: &[SocketAddr],
    ) { ... }
}

Required Methods§

Source

fn router(&self) -> &Router<N>

Returns a reference to the router.

Source

fn is_block_synced(&self) -> bool

Returns true if the node is synced up to the latest block (within the given tolerance).

Source

fn num_blocks_behind(&self) -> Option<u32>

Returns the number of blocks this node is behind the greatest peer height, or None if not connected to peers yet.

Provided Methods§

Source

fn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr])

Sends the given message to every connected peer, excluding the sender and any specified peer IPs.

Source

fn propagate_to_validators( &self, message: Message<N>, excluded_peers: &[SocketAddr], )

Sends the given message to every connected validator, excluding the sender and any specified IPs.

Implementors§