TransactionPropagationPolicy

Trait TransactionPropagationPolicy 

Source
pub trait TransactionPropagationPolicy<N>:
    Send
    + Sync
    + Unpin
    + Debug
    + 'static{
    // Required methods
    fn can_propagate(&self, peer: &mut PeerMetadata<N>) -> bool;
    fn on_session_established(&mut self, peer: &mut PeerMetadata<N>);
    fn on_session_closed(&mut self, peer: &mut PeerMetadata<N>);
}
Expand description

A policy defining which peers pending transactions are gossiped to.

Required Methods§

Source

fn can_propagate(&self, peer: &mut PeerMetadata<N>) -> bool

Filter a given peer based on the policy.

This determines whether transactions can be propagated to this peer.

Source

fn on_session_established(&mut self, peer: &mut PeerMetadata<N>)

A callback on the policy when a new peer session is established.

Source

fn on_session_closed(&mut self, peer: &mut PeerMetadata<N>)

A callback on the policy when a peer session is closed.

Implementors§