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 PeerManager
informed us that we’ve disconnected from the peer. We close channels
if the PeerManager
informed us that it is unlikely we’ll be able to connect to the
peer again in the future or if the peer disconnected before we finished negotiating
the channel open. The first case may be caused by incompatible features which our
counterparty, or we, require.
OutdatedChannelManager
Closure generated from ChannelManager::read
if the ChannelMonitor is newer than
the ChannelManager deserialized.
Trait Implementations
sourceimpl Clone for ClosureReason
impl Clone for ClosureReason
sourcefn clone(&self) -> ClosureReason
fn clone(&self) -> ClosureReason
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ClosureReason
impl Debug for ClosureReason
sourceimpl Display for ClosureReason
impl Display for ClosureReason
sourceimpl MaybeReadable for ClosureReason
impl MaybeReadable for ClosureReason
sourceimpl PartialEq<ClosureReason> for ClosureReason
impl PartialEq<ClosureReason> for ClosureReason
sourcefn eq(&self, other: &ClosureReason) -> bool
fn eq(&self, other: &ClosureReason) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ClosureReason) -> bool
fn ne(&self, other: &ClosureReason) -> bool
This method tests for !=
.
sourceimpl Writeable for ClosureReason
impl Writeable for ClosureReason
sourcefn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Writes self out to the given Writer
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn encode_with_len(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode_with_len(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
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
impl StructuralPartialEq for ClosureReason
Auto Trait Implementations
impl RefUnwindSafe for ClosureReason
impl Send for ClosureReason
impl Sync for ClosureReason
impl Unpin for ClosureReason
impl UnwindSafe for ClosureReason
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more