[][src]Trait lightning::ln::msgs::ChannelMessageHandler

pub trait ChannelMessageHandler: MessageSendEventsProvider + Send + Sync {
    fn handle_open_channel(
        &self,
        their_node_id: &PublicKey,
        their_local_features: LocalFeatures,
        msg: &OpenChannel
    ) -> Result<(), LightningError>;
fn handle_accept_channel(
        &self,
        their_node_id: &PublicKey,
        their_local_features: LocalFeatures,
        msg: &AcceptChannel
    ) -> Result<(), LightningError>;
fn handle_funding_created(
        &self,
        their_node_id: &PublicKey,
        msg: &FundingCreated
    ) -> Result<(), LightningError>;
fn handle_funding_signed(
        &self,
        their_node_id: &PublicKey,
        msg: &FundingSigned
    ) -> Result<(), LightningError>;
fn handle_funding_locked(
        &self,
        their_node_id: &PublicKey,
        msg: &FundingLocked
    ) -> Result<(), LightningError>;
fn handle_shutdown(
        &self,
        their_node_id: &PublicKey,
        msg: &Shutdown
    ) -> Result<(), LightningError>;
fn handle_closing_signed(
        &self,
        their_node_id: &PublicKey,
        msg: &ClosingSigned
    ) -> Result<(), LightningError>;
fn handle_update_add_htlc(
        &self,
        their_node_id: &PublicKey,
        msg: &UpdateAddHTLC
    ) -> Result<(), LightningError>;
fn handle_update_fulfill_htlc(
        &self,
        their_node_id: &PublicKey,
        msg: &UpdateFulfillHTLC
    ) -> Result<(), LightningError>;
fn handle_update_fail_htlc(
        &self,
        their_node_id: &PublicKey,
        msg: &UpdateFailHTLC
    ) -> Result<(), LightningError>;
fn handle_update_fail_malformed_htlc(
        &self,
        their_node_id: &PublicKey,
        msg: &UpdateFailMalformedHTLC
    ) -> Result<(), LightningError>;
fn handle_commitment_signed(
        &self,
        their_node_id: &PublicKey,
        msg: &CommitmentSigned
    ) -> Result<(), LightningError>;
fn handle_revoke_and_ack(
        &self,
        their_node_id: &PublicKey,
        msg: &RevokeAndACK
    ) -> Result<(), LightningError>;
fn handle_update_fee(
        &self,
        their_node_id: &PublicKey,
        msg: &UpdateFee
    ) -> Result<(), LightningError>;
fn handle_announcement_signatures(
        &self,
        their_node_id: &PublicKey,
        msg: &AnnouncementSignatures
    ) -> Result<(), LightningError>;
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<(), LightningError>;
fn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage); }

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

fn handle_open_channel(
    &self,
    their_node_id: &PublicKey,
    their_local_features: LocalFeatures,
    msg: &OpenChannel
) -> Result<(), LightningError>

Handle an incoming open_channel message from the given peer.

fn handle_accept_channel(
    &self,
    their_node_id: &PublicKey,
    their_local_features: LocalFeatures,
    msg: &AcceptChannel
) -> Result<(), LightningError>

Handle an incoming accept_channel message from the given peer.

fn handle_funding_created(
    &self,
    their_node_id: &PublicKey,
    msg: &FundingCreated
) -> Result<(), LightningError>

Handle an incoming funding_created message from the given peer.

fn handle_funding_signed(
    &self,
    their_node_id: &PublicKey,
    msg: &FundingSigned
) -> Result<(), LightningError>

Handle an incoming funding_signed message from the given peer.

fn handle_funding_locked(
    &self,
    their_node_id: &PublicKey,
    msg: &FundingLocked
) -> Result<(), LightningError>

Handle an incoming funding_locked message from the given peer.

fn handle_shutdown(
    &self,
    their_node_id: &PublicKey,
    msg: &Shutdown
) -> Result<(), LightningError>

Handle an incoming shutdown message from the given peer.

fn handle_closing_signed(
    &self,
    their_node_id: &PublicKey,
    msg: &ClosingSigned
) -> Result<(), LightningError>

Handle an incoming closing_signed message from the given peer.

fn handle_update_add_htlc(
    &self,
    their_node_id: &PublicKey,
    msg: &UpdateAddHTLC
) -> Result<(), LightningError>

Handle an incoming update_add_htlc message from the given peer.

fn handle_update_fulfill_htlc(
    &self,
    their_node_id: &PublicKey,
    msg: &UpdateFulfillHTLC
) -> Result<(), LightningError>

Handle an incoming update_fulfill_htlc message from the given peer.

fn handle_update_fail_htlc(
    &self,
    their_node_id: &PublicKey,
    msg: &UpdateFailHTLC
) -> Result<(), LightningError>

Handle an incoming update_fail_htlc message from the given peer.

fn handle_update_fail_malformed_htlc(
    &self,
    their_node_id: &PublicKey,
    msg: &UpdateFailMalformedHTLC
) -> Result<(), LightningError>

Handle an incoming update_fail_malformed_htlc message from the given peer.

fn handle_commitment_signed(
    &self,
    their_node_id: &PublicKey,
    msg: &CommitmentSigned
) -> Result<(), LightningError>

Handle an incoming commitment_signed message from the given peer.

fn handle_revoke_and_ack(
    &self,
    their_node_id: &PublicKey,
    msg: &RevokeAndACK
) -> Result<(), LightningError>

Handle an incoming revoke_and_ack message from the given peer.

fn handle_update_fee(
    &self,
    their_node_id: &PublicKey,
    msg: &UpdateFee
) -> Result<(), LightningError>

Handle an incoming update_fee message from the given peer.

fn handle_announcement_signatures(
    &self,
    their_node_id: &PublicKey,
    msg: &AnnouncementSignatures
) -> Result<(), LightningError>

Handle an incoming announcement_signatures message from the given peer.

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.

fn peer_connected(&self, their_node_id: &PublicKey)

Handle a peer reconnecting, possibly generating channel_reestablish message(s).

fn handle_channel_reestablish(
    &self,
    their_node_id: &PublicKey,
    msg: &ChannelReestablish
) -> Result<(), LightningError>

Handle an incoming channel_reestablish message from the given peer.

fn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage)

Handle an incoming error message from the given peer.

Loading content...

Implementors

impl<'a> ChannelMessageHandler for ChannelManager<'a>[src]

Loading content...