mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
bitcoin: add weight calculation helpers.
These are pulled from wallet/wallet.c, with the fix now that we grind sigs. This reduces the fees we pay slightly, as you can see in the coinmoves changes. I now print out all the coin moves in suitable format before we match: you only see this if the test fails, but it's really helpful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
1ef0ca51b0
commit
7aa8ffa2a0
@@ -69,7 +69,7 @@ static bool closing_fee_is_acceptable(struct lightningd *ld,
|
||||
type_to_string(tmpctx, struct amount_sat, &last_fee));
|
||||
|
||||
/* Weight once we add in sigs. */
|
||||
weight = bitcoin_tx_weight(tx) + 74 * 2;
|
||||
weight = bitcoin_tx_weight(tx) + bitcoin_tx_input_sig_weight() * 2;
|
||||
|
||||
/* If we don't have a feerate estimate, this gives feerate_floor */
|
||||
min_feerate = feerate_min(ld, &feerate_unknown);
|
||||
|
||||
Reference in New Issue
Block a user