pub enum ClosureReason {
    CounterpartyForceClosed {
        peer_msg: String,
    },
    HolderForceClosed,
    CooperativeClosure,
    CommitmentTxConfirmed,
    FundingTimedOut,
    ProcessingError {
        err: String,
    },
    DisconnectedPeer,
    OutdatedChannelManager,
}
Expand description

The reason the channel was closed. See individual variants more details.

Variants

CounterpartyForceClosed

Fields

peer_msg: String

The error which the peer sent us.

The string should be sanitized before it is used (e.g emitted to logs or printed to stdout). Otherwise, a well crafted error message may exploit a security vulnerability in the terminal emulator or the logging subsystem.

Closure generated from receiving a peer error message.

Our counterparty may have broadcasted their latest commitment state, and we have as well.

HolderForceClosed

Closure generated from ChannelManager::force_close_channel, called by the user.

CooperativeClosure

The channel was closed after negotiating a cooperative close and we’ve now broadcasted the cooperative close transaction. Note the shutdown may have been initiated by us.

CommitmentTxConfirmed

A commitment transaction was confirmed on chain, closing the channel. Most likely this commitment transaction came from our counterparty, but it may also have come from a copy of our own ChannelMonitor.

FundingTimedOut

The funding transaction failed to confirm in a timely manner on an inbound channel.

ProcessingError

Fields

err: String

A developer-readable error message which we generated.

Closure generated from processing an event, likely a HTLC forward/relay/reception.

DisconnectedPeer

The peer disconnected prior to funding completing. In this case the spec mandates that we forget the channel entirely - we can attempt again if the peer reconnects.

In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the peer because of mutual incompatibility between us and our channel counterparty.

OutdatedChannelManager

Closure generated from ChannelManager::read if the ChannelMonitor is newer than the ChannelManager deserialized.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Reads a Self in from the given Read

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Writes self out to the given Writer

Writes self out to a Vec

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.