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

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: PaymentHash,
        amt: u64,
    },
    PaymentSent {
        payment_preimage: PaymentPreimage,
    },
    PaymentFailed {
        payment_hash: PaymentHash,
        rejected_by_dest: bool,
    },
    PendingHTLCsForwardable {
        time_forwardable: Instant,
    },
    SpendableOutputs {
        outputs: Vec<SpendableOutputDescriptor>,
    },
}

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

Variants

FundingGenerationReady

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. Note that all inputs in the funding transaction must spend SegWit outputs or your counterparty can steal your funds!

Fields of FundingGenerationReady

temporary_channel_id: [u8; 32]

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

channel_value_satoshis: u64

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

output_script: Script

The script which should be used in the transaction output.

user_channel_id: u64

The value passed in to ChannelManager::create_channel

FundingBroadcastSafe

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

funding_txo: OutPoint

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

user_channel_id: u64

The value passed in to ChannelManager::create_channel

PaymentReceived

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 or the amount paid is incorrect, you must call ChannelManager::fail_htlc_backwards to free up resources for this HTLC. The amount paid should be considered 'incorrect' when it is less than or more than twice the amount expected.

Fields of PaymentReceived

payment_hash: PaymentHash

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

amt: u64

The value, in thousandths of a satoshi, that this payment is for. Note that you must compare this to the expected value before accepting the payment (as otherwise you are providing proof-of-payment for less than the value you expected!).

PaymentSent

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). Note that duplicative PaymentSent Events may be generated - it is your responsibility to deduplicate them by payment_preimage (which MUST be unique)!

Fields of PaymentSent

payment_preimage: PaymentPreimage

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!

PaymentFailed

Indicates an outbound payment we made failed. Probably some intermediary node dropped something. You may wish to retry with a different route. Note that duplicative PaymentFailed Events may be generated - it is your responsibility to deduplicate them by payment_hash (which MUST be unique)!

Fields of PaymentFailed

payment_hash: PaymentHash

The hash which was given to ChannelManager::send_payment.

rejected_by_dest: bool

Indicates the payment was rejected for some reason by the recipient. This implies that the payment has failed, not just the route in question. If this is not set, you may retry the payment via a different route.

PendingHTLCsForwardable

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

Fields of PendingHTLCsForwardable

time_forwardable: Instant

The earliest time at which process_pending_htlc_forwards should be called.

SpendableOutputs

Used to indicate that an output was generated on-chain which you should know how to spend. Such an output will not ever be spent by rust-lightning, so you need to store them somewhere and spend them when you create on-chain spends.

Fields of SpendableOutputs

outputs: Vec<SpendableOutputDescriptor>

The outputs which you should store as spendable by you.

Auto Trait Implementations

impl Send for Event

impl Sync for Event

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]