Enum lightning::util::events::Event[][src]

pub enum Event {
    FundingGenerationReady {
        temporary_channel_id: [u8; 32],
        channel_value_satoshis: u64,
        output_script: Script,
        user_channel_id: u64,
    },
    FundingBroadcastSafe {
        funding_txo: OutPoint,
        user_channel_id: u64,
    },
    PaymentReceived {
        payment_hash: [u8; 32],
        amt: u64,
    },
    PaymentSent {
        payment_preimage: [u8; 32],
    },
    PaymentFailed {
        payment_hash: [u8; 32],
    },
    PendingHTLCsForwardable {
        time_forwardable: Instant,
    },
    SendOpenChannel {
        node_id: PublicKey,
        msg: OpenChannel,
    },
    SendFundingCreated {
        node_id: PublicKey,
        msg: FundingCreated,
    },
    SendFundingLocked {
        node_id: PublicKey,
        msg: FundingLocked,
        announcement_sigs: Option<AnnouncementSignatures>,
    },
    UpdateHTLCs {
        node_id: PublicKey,
        updates: CommitmentUpdate,
    },
    SendShutdown {
        node_id: PublicKey,
        msg: Shutdown,
    },
    BroadcastChannelAnnouncement {
        msg: ChannelAnnouncement,
        update_msg: ChannelUpdate,
    },
    BroadcastChannelUpdate {
        msg: ChannelUpdate,
    },
    HandleError {
        node_id: PublicKey,
        action: Option<ErrorAction>,
    },
}

An Event which you should probably take some action in response to.

Variants

Used to indicate that the client should generate a funding transaction with the given parameters and then call ChannelManager::funding_transaction_generated. Generated in ChannelManager message handling.

Fields of FundingGenerationReady

The random channel_id we picked which you'll need to pass into ChannelManager::funding_transaction_generated.

The value, in satoshis, that the output should have.

The script which should be used in the transaction output.

The value passed in to ChannelManager::create_channel

Used to indicate that the client may now broadcast the funding transaction it created for a channel. Broadcasting such a transaction prior to this event may lead to our counterparty trivially stealing all funds in the funding transaction!

Fields of FundingBroadcastSafe

The output, which was passed to ChannelManager::funding_transaction_generated, which is now safe to broadcast.

The value passed in to ChannelManager::create_channel

Indicates we've received money! Just gotta dig out that payment preimage and feed it to ChannelManager::claim_funds to get it.... Note that if the preimage is not known, you must call ChannelManager::fail_htlc_backwards to free up resources for this HTLC.

Fields of PaymentReceived

The hash for which the preimage should be handed to the ChannelManager.

The value, in thousandths of a satoshi, that this payment is for.

Indicates an outbound payment we made succeeded (ie it made it all the way to its target and we got back the payment preimage for it).

Fields of PaymentSent

The preimage to the hash given to ChannelManager::send_payment. Note that this serves as a payment receipt, if you wish to have such a thing, you must store it somehow!

Indicates an outbound payment we made failed. Probably some intermediary node dropped something. You may wish to retry with a different route.

Fields of PaymentFailed

The hash which was given to ChannelManager::send_payment.

Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a time in the future.

Fields of PendingHTLCsForwardable

The earliest time at which process_pending_htlc_forwards should be called.

Used to indicate that we've initialted a channel open and should send the open_channel message provided to the given peer. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of SendOpenChannel

The node_id of the node which should receive this message

The message which should be sent.

Used to indicate that a funding_created message should be sent to the peer with the given node_id. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of SendFundingCreated

The node_id of the node which should receive this message

The message which should be sent.

Used to indicate that a funding_locked message should be sent to the peer with the given node_id. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of SendFundingLocked

The node_id of the node which should receive these message(s)

The funding_locked message which should be sent.

An optional additional announcement_signatures message which should be sent.

Used to indicate that a series of HTLC update messages, as well as a commitment_signed message should be sent to the peer with the given node_id. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of UpdateHTLCs

The node_id of the node which should receive these message(s)

The update messages which should be sent. ALL messages in the struct should be sent!

Used to indicate that a shutdown message should be sent to the peer with the given node_id. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of SendShutdown

The node_id of the node which should receive this message

The message which should be sent.

Used to indicate that a channel_announcement and channel_update should be broadcast to all peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2). This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of BroadcastChannelAnnouncement

The channel_announcement which should be sent.

The followup channel_update which should be sent.

Used to indicate that a channel_update should be broadcast to all peers. This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of BroadcastChannelUpdate

The channel_update which should be sent.

Broadcast an error downstream to be handled This event is handled by PeerManager::process_events if you are using a PeerManager.

Fields of HandleError

The node_id of the node which should receive this message

The action which should be taken.

Auto Trait Implementations

impl Send for Event

impl Sync for Event