@@ -47,6 +47,8 @@ use crate::ln::chan_utils::{
4747 get_commitment_transaction_number_obscure_factor,
4848 ClosingTransaction, commit_tx_fee_sat, per_outbound_htlc_counterparty_commit_tx_fee_msat,
4949};
50+ #[cfg(splicing)]
51+ use crate::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT;
5052use crate::ln::chan_utils;
5153use crate::ln::onion_utils::HTLCFailReason;
5254use crate::chain::BestBlock;
@@ -55,8 +57,6 @@ use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Channel
5557use crate::chain::transaction::{OutPoint, TransactionData};
5658use crate::sign::ecdsa::EcdsaChannelSigner;
5759use crate::sign::{EntropySource, ChannelSigner, SignerProvider, NodeSigner, Recipient};
58- #[cfg(splicing)]
59- use crate::sign::P2WPKH_WITNESS_WEIGHT;
6060use crate::events::{ClosureReason, Event};
6161use crate::events::bump_transaction::BASE_INPUT_WEIGHT;
6262use crate::routing::gossip::NodeId;
@@ -8268,8 +8268,7 @@ impl<SP: Deref> FundedChannel<SP> where
82688268 let funding_input_count = our_funding_inputs.len() + 1;
82698269 // Input witness weight, extended with weight for spending old funding
82708270 let total_witness_weight = Weight::from_wu(
8271- witness_weight.to_wu()
8272- .saturating_add(2 * P2WPKH_WITNESS_WEIGHT)
8271+ witness_weight.to_wu().saturating_add(FUNDING_TRANSACTION_WITNESS_WEIGHT)
82738272 );
82748273 let estimated_fee = estimate_funding_transaction_fee(true, funding_input_count, total_witness_weight, funding_feerate_per_kw);
82758274 let available_input = sum_input.saturating_sub(estimated_fee);
0 commit comments