Trait lightning::ln::peer_handler::CustomMessageHandler
source · [−]pub trait CustomMessageHandler: CustomMessageReader {
fn handle_custom_message(
&self,
msg: Self::CustomMessage,
sender_node_id: &PublicKey
) -> Result<(), LightningError>;
fn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::CustomMessage)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
}
Expand description
Handler for BOLT1-compliant messages.
Required Methods
fn handle_custom_message(
&self,
msg: Self::CustomMessage,
sender_node_id: &PublicKey
) -> Result<(), LightningError>
fn handle_custom_message(
&self,
msg: Self::CustomMessage,
sender_node_id: &PublicKey
) -> Result<(), LightningError>
Called with the message type that was received and the buffer to be read.
Can return a MessageHandlingError
if the message could not be handled.
Gets the list of pending messages which were generated by the custom message handler, clearing the list in the process. The first tuple element must correspond to the intended recipients node ids. If no connection to one of the specified node does not exist, the message is simply not sent to it.