Skip to content

Commit 740b838

Browse files
committed
f adapt to new api
1 parent e3103d4 commit 740b838

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE: u64 = 2;
382382
/// If we fail to see a funding transaction confirmed on-chain within this many blocks after the
383383
/// channel creation on an inbound channel, we simply force-close and move on.
384384
/// This constant is the one suggested in BOLT 2.
385-
const FUNDING_CONF_DEADLINE_BLOCKS: u32 = 2016;
385+
pub(crate) const FUNDING_CONF_DEADLINE_BLOCKS: u32 = 2016;
386386

387387
// TODO: We should refactor this to be an Inbound/OutboundChannel until initial setup handshaking
388388
// has been completed, and then turn into a Channel to get compiler-time enforcement of things like
@@ -4259,10 +4259,7 @@ impl<Signer: Sign> Channel<Signer> {
42594259
// If funding_tx_confirmed_in is unset, the channel must not be active
42604260
assert!(non_shutdown_state <= ChannelState::ChannelFunded as u32);
42614261
assert_eq!(non_shutdown_state & ChannelState::OurFundingLocked as u32, 0);
4262-
return Err((msgs::ErrorMessage {
4263-
channel_id: self.channel_id(),
4264-
data: format!("Funding transaction failed to confirm within {} blocks", FUNDING_CONF_DEADLINE_BLOCKS),
4265-
}, ClosureReason::FundingTimedOut));
4262+
return Err(ClosureReason::FundingTimedOut);
42664263
}
42674264

42684265
Ok((None, timed_out_htlcs))

lightning/src/ln/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub(crate) mod peer_channel_encryptor;
3737
#[cfg(feature = "fuzztarget")]
3838
pub mod channel;
3939
#[cfg(not(feature = "fuzztarget"))]
40-
mod channel;
40+
pub(crate) mod channel;
4141

4242
mod onion_utils;
4343
pub mod wire;

lightning/src/util/events.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
use chain::keysinterface::SpendableOutputDescriptor;
1818
use ln::channelmanager::PaymentId;
19+
use ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
1920
use ln::msgs;
2021
use ln::msgs::DecodeError;
2122
use ln::{PaymentPreimage, PaymentHash, PaymentSecret};
@@ -131,6 +132,7 @@ impl core::fmt::Display for ClosureReason {
131132
ClosureReason::HolderForceClosed => f.write_str("user manually force-closed the channel"),
132133
ClosureReason::CooperativeClosure => f.write_str("the channel was cooperatively closed"),
133134
ClosureReason::CommitmentTxConfirmed => f.write_str("commitment or closing transaction was confirmed on chain."),
135+
ClosureReason::FundingTimedOut => write!(f, "Funding transaction failed to confirm within {} blocks", FUNDING_CONF_DEADLINE_BLOCKS),
134136
ClosureReason::ProcessingError { err } => {
135137
f.write_str("of an exception: ")?;
136138
f.write_str(&err)

0 commit comments

Comments
 (0)