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§
Sourcefn is_block_synced(&self) -> bool
fn is_block_synced(&self) -> bool
Returns true
if the node is synced up to the latest block (within the given tolerance).
Sourcefn num_blocks_behind(&self) -> Option<u32>
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§
Sourcefn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr])
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.
Sourcefn propagate_to_validators(
&self,
message: Message<N>,
excluded_peers: &[SocketAddr],
)
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.