X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fevents.rs;h=6bbd6b9946ccc49e18ae7b85a715b23d2478f4ad;hb=ab11f450b67628284e80c28bce2b7d1e9033e97e;hp=c021fe3c16b9dda30f7b8a75189d3785323fe2a2;hpb=b288a2739afa18c5aedaacb00ed809c98be47187;p=rust-lightning diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index c021fe3c1..6bbd6b994 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -16,6 +16,7 @@ use chain::keysinterface::SpendableOutputDescriptor; use ln::channelmanager::PaymentId; +use ln::channel::FUNDING_CONF_DEADLINE_BLOCKS; use ln::msgs; use ln::msgs::DecodeError; use ln::{PaymentPreimage, PaymentHash, PaymentSecret}; @@ -101,6 +102,8 @@ pub enum ClosureReason { /// commitment transaction came from our counterparty, but it may also have come from /// a copy of our own `ChannelMonitor`. CommitmentTxConfirmed, + /// The funding transaction failed to confirm in a timely manner on an inbound channel. + FundingTimedOut, /// Closure generated from processing an event, likely a HTLC forward/relay/reception. ProcessingError { /// A developer-readable error message which we generated. @@ -129,6 +132,7 @@ impl core::fmt::Display for ClosureReason { ClosureReason::HolderForceClosed => f.write_str("user manually force-closed the channel"), ClosureReason::CooperativeClosure => f.write_str("the channel was cooperatively closed"), ClosureReason::CommitmentTxConfirmed => f.write_str("commitment or closing transaction was confirmed on chain."), + ClosureReason::FundingTimedOut => write!(f, "funding transaction failed to confirm within {} blocks", FUNDING_CONF_DEADLINE_BLOCKS), ClosureReason::ProcessingError { err } => { f.write_str("of an exception: ")?; f.write_str(&err) @@ -141,6 +145,7 @@ impl core::fmt::Display for ClosureReason { impl_writeable_tlv_based_enum_upgradable!(ClosureReason, (0, CounterpartyForceClosed) => { (1, peer_msg, required) }, + (1, FundingTimedOut) => {}, (2, HolderForceClosed) => {}, (6, CommitmentTxConfirmed) => {}, (4, CooperativeClosure) => {},