Enum ClosureReason
pub enum ClosureReason {
Show 14 variants
CounterpartyForceClosed {
peer_msg: UntrustedString,
},
HolderForceClosed {
broadcasted_latest_txn: Option<bool>,
},
LegacyCooperativeClosure,
CounterpartyInitiatedCooperativeClosure,
LocallyInitiatedCooperativeClosure,
CommitmentTxConfirmed,
FundingTimedOut,
ProcessingError {
err: String,
},
DisconnectedPeer,
OutdatedChannelManager,
CounterpartyCoopClosedUnfundedChannel,
FundingBatchClosure,
HTLCsTimedOut,
PeerFeerateTooLow {
peer_feerate_sat_per_kw: u32,
required_feerate_sat_per_kw: u32,
},
}
Expand description
The reason the channel was closed. See individual variants for more details.
Variants§
CounterpartyForceClosed
Closure generated from receiving a peer error message.
Our counterparty may have broadcasted their latest commitment state, and we have as well.
Fields
peer_msg: UntrustedString
The error which the peer sent us.
Be careful about printing the peer_msg, a well-crafted message could exploit
a security vulnerability in the terminal emulator or the logging subsystem.
To be safe, use Display
on UntrustedString
HolderForceClosed
Closure generated from ChannelManager::force_close_channel
, called by the user.
Fields
broadcasted_latest_txn: Option<bool>
Whether or not the latest transaction was broadcasted when the channel was force closed.
Channels closed using ChannelManager::force_close_broadcasting_latest_txn
will have
this field set to true, whereas channels closed using ChannelManager::force_close_without_broadcasting_txn
or force-closed prior to being funded will have this field set to false.
This will be None
for objects generated or written by LDK 0.0.123 and
earlier.
LegacyCooperativeClosure
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.
This was only set in versions of LDK prior to 0.0.122.
CounterpartyInitiatedCooperativeClosure
The channel was closed after negotiating a cooperative close and we’ve now broadcasted the cooperative close transaction. This indicates that the shutdown was initiated by our counterparty.
In rare cases where we initiated closure immediately prior to shutting down without persisting, this value may be provided for channels we initiated closure for.
LocallyInitiatedCooperativeClosure
The channel was closed after negotiating a cooperative close and we’ve now broadcasted the cooperative close transaction. This indicates that the shutdown was 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
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.
This includes cases where we restarted prior to funding completion, including prior to the
initial ChannelMonitor
persistence completing.
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.
CounterpartyCoopClosedUnfundedChannel
The counterparty requested a cooperative close of a channel that had not been funded yet. The channel has been immediately closed.
FundingBatchClosure
Another channel in the same funding batch closed before the funding transaction was ready to be broadcast.
HTLCsTimedOut
One of our HTLCs timed out in a channel, causing us to force close the channel.
PeerFeerateTooLow
Our peer provided a feerate which violated our required minimum (fetched from our
FeeEstimator
either as ConfirmationTarget::MinAllowedAnchorChannelRemoteFee
or
ConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee
).
Fields
required_feerate_sat_per_kw: u32
The required feerate we enforce, from our FeeEstimator
.
Trait Implementations§
§impl Clone for ClosureReason
impl Clone for ClosureReason
§fn clone(&self) -> ClosureReason
fn clone(&self) -> ClosureReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ClosureReason
impl Debug for ClosureReason
§impl Display for ClosureReason
impl Display for ClosureReason
§impl MaybeReadable for ClosureReason
impl MaybeReadable for ClosureReason
§fn read<R>(reader: &mut R) -> Result<Option<ClosureReason>, DecodeError>where
R: Read,
fn read<R>(reader: &mut R) -> Result<Option<ClosureReason>, DecodeError>where
R: Read,
Self
in from the given Read
.§impl PartialEq for ClosureReason
impl PartialEq for ClosureReason
§impl Writeable for ClosureReason
impl Writeable for ClosureReason
impl Eq for ClosureReason
impl StructuralPartialEq for ClosureReason
Auto Trait Implementations§
impl Freeze for ClosureReason
impl RefUnwindSafe for ClosureReason
impl Send for ClosureReason
impl Sync for ClosureReason
impl Unpin for ClosureReason
impl UnwindSafe for ClosureReason
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request