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§
Sourcefn handle_onion_message(&self, peer_node_id: PublicKey, msg: &OnionMessage)
fn handle_onion_message(&self, peer_node_id: PublicKey, msg: &OnionMessage)
Handle an incoming onion_message message from the given peer.
Sourcefn next_onion_message_for_peer(
&self,
peer_node_id: PublicKey,
) -> Option<OnionMessage>
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.
Sourcefn timer_tick_occurred(&self)
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.