lightning::onion_message::async_payments

Trait AsyncPaymentsMessageHandler

source
pub trait AsyncPaymentsMessageHandler {
    // Required methods
    fn held_htlc_available(
        &self,
        message: HeldHtlcAvailable,
        responder: Option<Responder>,
    ) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>;
    fn release_held_htlc(&self, message: ReleaseHeldHtlc);

    // Provided method
    fn release_pending_messages(
        &self,
    ) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)> { ... }
}
Expand description

A handler for an OnionMessage containing an async payments message as its payload.

Required Methods§

source

fn held_htlc_available( &self, message: HeldHtlcAvailable, responder: Option<Responder>, ) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>

Handle a HeldHtlcAvailable message. A ReleaseHeldHtlc should be returned to release the held funds.

source

fn release_held_htlc(&self, message: ReleaseHeldHtlc)

Handle a ReleaseHeldHtlc message. If authentication of the message succeeds, an HTLC should be released to the corresponding payee.

Provided Methods§

source

fn release_pending_messages( &self, ) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)>

Release any AsyncPaymentsMessages that need to be sent.

Typically, this is used for messages initiating an async payment flow rather than in response to another message.

Implementors§