Trait lightning::ln::msgs::ChannelMessageHandler
source · pub trait ChannelMessageHandler: MessageSendEventsProvider + Send + Sync {
Show 19 methods
fn handle_open_channel(
&self,
their_node_id: &PublicKey,
msg: &OpenChannel
) -> Result<(), HandleError>;
fn handle_accept_channel(
&self,
their_node_id: &PublicKey,
msg: &AcceptChannel
) -> Result<(), HandleError>;
fn handle_funding_created(
&self,
their_node_id: &PublicKey,
msg: &FundingCreated
) -> Result<(), HandleError>;
fn handle_funding_signed(
&self,
their_node_id: &PublicKey,
msg: &FundingSigned
) -> Result<(), HandleError>;
fn handle_funding_locked(
&self,
their_node_id: &PublicKey,
msg: &FundingLocked
) -> Result<(), HandleError>;
fn handle_shutdown(
&self,
their_node_id: &PublicKey,
msg: &Shutdown
) -> Result<(), HandleError>;
fn handle_closing_signed(
&self,
their_node_id: &PublicKey,
msg: &ClosingSigned
) -> Result<(), HandleError>;
fn handle_update_add_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateAddHTLC
) -> Result<(), HandleError>;
fn handle_update_fulfill_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFulfillHTLC
) -> Result<(), HandleError>;
fn handle_update_fail_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailHTLC
) -> Result<(), HandleError>;
fn handle_update_fail_malformed_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailMalformedHTLC
) -> Result<(), HandleError>;
fn handle_commitment_signed(
&self,
their_node_id: &PublicKey,
msg: &CommitmentSigned
) -> Result<(), HandleError>;
fn handle_revoke_and_ack(
&self,
their_node_id: &PublicKey,
msg: &RevokeAndACK
) -> Result<(), HandleError>;
fn handle_update_fee(
&self,
their_node_id: &PublicKey,
msg: &UpdateFee
) -> Result<(), HandleError>;
fn handle_announcement_signatures(
&self,
their_node_id: &PublicKey,
msg: &AnnouncementSignatures
) -> Result<(), HandleError>;
fn peer_disconnected(
&self,
their_node_id: &PublicKey,
no_connection_possible: bool
);
fn peer_connected(&self, their_node_id: &PublicKey);
fn handle_channel_reestablish(
&self,
their_node_id: &PublicKey,
msg: &ChannelReestablish
) -> Result<(), HandleError>;
fn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage);
}
Expand description
A trait to describe an object which can receive channel messages.
Messages MAY be called in parallel when they originate from different their_node_ids, however they MUST NOT be called in parallel when the two calls have the same their_node_id.
Required Methods
sourcefn handle_open_channel(
&self,
their_node_id: &PublicKey,
msg: &OpenChannel
) -> Result<(), HandleError>
fn handle_open_channel(
&self,
their_node_id: &PublicKey,
msg: &OpenChannel
) -> Result<(), HandleError>
Handle an incoming open_channel message from the given peer.
sourcefn handle_accept_channel(
&self,
their_node_id: &PublicKey,
msg: &AcceptChannel
) -> Result<(), HandleError>
fn handle_accept_channel(
&self,
their_node_id: &PublicKey,
msg: &AcceptChannel
) -> Result<(), HandleError>
Handle an incoming accept_channel message from the given peer.
sourcefn handle_funding_created(
&self,
their_node_id: &PublicKey,
msg: &FundingCreated
) -> Result<(), HandleError>
fn handle_funding_created(
&self,
their_node_id: &PublicKey,
msg: &FundingCreated
) -> Result<(), HandleError>
Handle an incoming funding_created message from the given peer.
sourcefn handle_funding_signed(
&self,
their_node_id: &PublicKey,
msg: &FundingSigned
) -> Result<(), HandleError>
fn handle_funding_signed(
&self,
their_node_id: &PublicKey,
msg: &FundingSigned
) -> Result<(), HandleError>
Handle an incoming funding_signed message from the given peer.
sourcefn handle_funding_locked(
&self,
their_node_id: &PublicKey,
msg: &FundingLocked
) -> Result<(), HandleError>
fn handle_funding_locked(
&self,
their_node_id: &PublicKey,
msg: &FundingLocked
) -> Result<(), HandleError>
Handle an incoming funding_locked message from the given peer.
sourcefn handle_shutdown(
&self,
their_node_id: &PublicKey,
msg: &Shutdown
) -> Result<(), HandleError>
fn handle_shutdown(
&self,
their_node_id: &PublicKey,
msg: &Shutdown
) -> Result<(), HandleError>
Handle an incoming shutdown message from the given peer.
sourcefn handle_closing_signed(
&self,
their_node_id: &PublicKey,
msg: &ClosingSigned
) -> Result<(), HandleError>
fn handle_closing_signed(
&self,
their_node_id: &PublicKey,
msg: &ClosingSigned
) -> Result<(), HandleError>
Handle an incoming closing_signed message from the given peer.
sourcefn handle_update_add_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateAddHTLC
) -> Result<(), HandleError>
fn handle_update_add_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateAddHTLC
) -> Result<(), HandleError>
Handle an incoming update_add_htlc message from the given peer.
sourcefn handle_update_fulfill_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFulfillHTLC
) -> Result<(), HandleError>
fn handle_update_fulfill_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFulfillHTLC
) -> Result<(), HandleError>
Handle an incoming update_fulfill_htlc message from the given peer.
sourcefn handle_update_fail_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailHTLC
) -> Result<(), HandleError>
fn handle_update_fail_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailHTLC
) -> Result<(), HandleError>
Handle an incoming update_fail_htlc message from the given peer.
sourcefn handle_update_fail_malformed_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailMalformedHTLC
) -> Result<(), HandleError>
fn handle_update_fail_malformed_htlc(
&self,
their_node_id: &PublicKey,
msg: &UpdateFailMalformedHTLC
) -> Result<(), HandleError>
Handle an incoming update_fail_malformed_htlc message from the given peer.
sourcefn handle_commitment_signed(
&self,
their_node_id: &PublicKey,
msg: &CommitmentSigned
) -> Result<(), HandleError>
fn handle_commitment_signed(
&self,
their_node_id: &PublicKey,
msg: &CommitmentSigned
) -> Result<(), HandleError>
Handle an incoming commitment_signed message from the given peer.
sourcefn handle_revoke_and_ack(
&self,
their_node_id: &PublicKey,
msg: &RevokeAndACK
) -> Result<(), HandleError>
fn handle_revoke_and_ack(
&self,
their_node_id: &PublicKey,
msg: &RevokeAndACK
) -> Result<(), HandleError>
Handle an incoming revoke_and_ack message from the given peer.
sourcefn handle_update_fee(
&self,
their_node_id: &PublicKey,
msg: &UpdateFee
) -> Result<(), HandleError>
fn handle_update_fee(
&self,
their_node_id: &PublicKey,
msg: &UpdateFee
) -> Result<(), HandleError>
Handle an incoming update_fee message from the given peer.
sourcefn handle_announcement_signatures(
&self,
their_node_id: &PublicKey,
msg: &AnnouncementSignatures
) -> Result<(), HandleError>
fn handle_announcement_signatures(
&self,
their_node_id: &PublicKey,
msg: &AnnouncementSignatures
) -> Result<(), HandleError>
Handle an incoming announcement_signatures message from the given peer.
sourcefn peer_disconnected(
&self,
their_node_id: &PublicKey,
no_connection_possible: bool
)
fn peer_disconnected(
&self,
their_node_id: &PublicKey,
no_connection_possible: bool
)
Indicates a connection to the peer failed/an existing connection was lost. If no connection is believed to be possible in the future (eg they’re sending us messages we don’t understand or indicate they require unknown feature bits), no_connection_possible is set and any outstanding channels should be failed.
sourcefn peer_connected(&self, their_node_id: &PublicKey)
fn peer_connected(&self, their_node_id: &PublicKey)
Handle a peer reconnecting, possibly generating channel_reestablish message(s).
sourcefn handle_channel_reestablish(
&self,
their_node_id: &PublicKey,
msg: &ChannelReestablish
) -> Result<(), HandleError>
fn handle_channel_reestablish(
&self,
their_node_id: &PublicKey,
msg: &ChannelReestablish
) -> Result<(), HandleError>
Handle an incoming channel_reestablish message from the given peer.
sourcefn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage)
fn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage)
Handle an incoming error message from the given peer.