Trait OnionMessageHandler

Source
pub trait OnionMessageHandler: BaseMessageHandler {
    // Required methods
    fn handle_onion_message(&self, peer_node_id: PublicKey, msg: &OnionMessage);
    fn next_onion_message_for_peer(
        &self,
        peer_node_id: PublicKey,
    ) -> Option<OnionMessage>;
    fn timer_tick_occurred(&self);
}
Expand description

A handler for received OnionMessages and for providing generated ones to send.

Required Methods§

Source

fn handle_onion_message(&self, peer_node_id: PublicKey, msg: &OnionMessage)

Handle an incoming onion_message message from the given peer.

Source

fn next_onion_message_for_peer( &self, peer_node_id: PublicKey, ) -> Option<OnionMessage>

Returns the next pending onion message for the peer with the given node id.

Note that onion messages can only be provided upstream via this method and not via BaseMessageHandler::get_and_clear_pending_msg_events.

Source

fn timer_tick_occurred(&self)

Performs actions that should happen roughly every ten seconds after startup. Allows handlers to drop any buffered onion messages intended for prospective peerst.

Implementors§