mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +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
@@ -113,3 +113,8 @@ struct bitcoin_tx *tx_spending_utxos(const tal_t *ctx,
|
||||
|
||||
return tx;
|
||||
}
|
||||
|
||||
size_t utxo_spend_weight(const struct utxo *utxo)
|
||||
{
|
||||
return bitcoin_tx_simple_input_weight(utxo->is_p2sh);
|
||||
}
|
||||
|
||||
@@ -59,4 +59,6 @@ struct bitcoin_tx *tx_spending_utxos(const tal_t *ctx,
|
||||
u32 nlocktime,
|
||||
u32 nsequence);
|
||||
|
||||
/* Estimate of (signed) UTXO weight in transaction */
|
||||
size_t utxo_spend_weight(const struct utxo *utxo);
|
||||
#endif /* LIGHTNING_COMMON_UTXO_H */
|
||||
|
||||
Reference in New Issue
Block a user