mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-21 05:54:20 +01:00
closingd, lightningd: use bitcoin_tx_2of2_input_witness_weight
This fixes lightningd's chronic weight underestimate. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: closingd: more accurate weight estimation helps mutual closing near min/max feerates.
This commit is contained in:
committed by
Christian Decker
parent
8a8d7c4243
commit
de28bbd792
@@ -202,7 +202,9 @@ static bool closing_fee_is_acceptable(struct lightningd *ld,
|
||||
last_fee = calc_tx_fee(channel->funding_sats, channel->last_tx);
|
||||
|
||||
/* Weight once we add in sigs. */
|
||||
weight = bitcoin_tx_weight(tx) + bitcoin_tx_input_sig_weight() * 2;
|
||||
assert(!tx->wtx->inputs[0].witness
|
||||
|| tx->wtx->inputs[0].witness->num_items == 0);
|
||||
weight = bitcoin_tx_weight(tx) + bitcoin_tx_2of2_input_witness_weight();
|
||||
|
||||
log_debug(channel->log, "Their actual closing tx fee is %s"
|
||||
" vs previous %s: weight is %"PRIu64,
|
||||
|
||||
Reference in New Issue
Block a user