@@ -47,6 +47,8 @@ use crate::ln::chan_utils::{
47
47
get_commitment_transaction_number_obscure_factor,
48
48
ClosingTransaction, commit_tx_fee_sat,
49
49
};
50
+ #[cfg(splicing)]
51
+ use crate::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT;
50
52
use crate::ln::chan_utils;
51
53
use crate::ln::onion_utils::HTLCFailReason;
52
54
use crate::chain::BestBlock;
@@ -55,8 +57,6 @@ use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Channel
55
57
use crate::chain::transaction::{OutPoint, TransactionData};
56
58
use crate::sign::ecdsa::EcdsaChannelSigner;
57
59
use crate::sign::{EntropySource, ChannelSigner, SignerProvider, NodeSigner, Recipient};
58
- #[cfg(splicing)]
59
- use crate::sign::P2WPKH_WITNESS_WEIGHT;
60
60
use crate::events::{ClosureReason, Event};
61
61
use crate::events::bump_transaction::BASE_INPUT_WEIGHT;
62
62
use crate::routing::gossip::NodeId;
@@ -8443,8 +8443,7 @@ impl<SP: Deref> FundedChannel<SP> where
8443
8443
let funding_input_count = our_funding_inputs.len() + 1;
8444
8444
// Input witness weight, extended with weight for spending old funding
8445
8445
let total_witness_weight = Weight::from_wu(
8446
- witness_weight.to_wu()
8447
- .saturating_add(2 * P2WPKH_WITNESS_WEIGHT)
8446
+ witness_weight.to_wu().saturating_add(FUNDING_TRANSACTION_WITNESS_WEIGHT)
8448
8447
);
8449
8448
let estimated_fee = estimate_v2_funding_transaction_fee(true, funding_input_count, total_witness_weight, funding_feerate_per_kw);
8450
8449
let available_input = sum_input.saturating_sub(estimated_fee);
0 commit comments