mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
funding tx: include segwit marker + flag in fee calculation
Noticed an off by one error when running tests for dual-funding; we're not including the two 'header' segwit bytes in our weight calculations.
This commit is contained in:
committed by
Rusty Russell
parent
b0b6ddb66f
commit
c7f3fa34b2
@@ -184,7 +184,8 @@ struct command_result *wtx_from_utxos(struct wallet_tx *tx,
|
||||
|
||||
/* The transaction has `tal_count(tx.utxos)` inputs and one output */
|
||||
/* (version + in count + out count + locktime) (index + value + script length) */
|
||||
weight = 4 * (4 + 1 + 1 + 4) + 4 * (8 + 1 + out_len);
|
||||
/* + segwit marker + flag */
|
||||
weight = 4 * (4 + 1 + 1 + 4) + 4 * (8 + 1 + out_len) + 1 + 1;
|
||||
for (size_t i = 0; i < tal_count(utxos); i++) {
|
||||
if (!*utxos[i]->blockheight || *utxos[i]->blockheight > maxheight) {
|
||||
tal_arr_remove(&utxos, i);
|
||||
|
||||
Reference in New Issue
Block a user