elements: Fix missing witness script entry for fee outputs

Fixes #3487
This commit is contained in:
Christian Decker
2020-02-07 14:55:46 +01:00
parent de5eaf2238
commit 9521549c49
3 changed files with 7 additions and 3 deletions

View File

@@ -207,8 +207,6 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
assert(n <= tx->wtx->num_outputs);
tal_resize(&(tx->output_witscripts), n);
/* BOLT #3:
*
* 7. Sort the outputs into [BIP 69+CLTV
@@ -244,6 +242,8 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
bitcoin_tx_add_input(tx, funding_txid, funding_txout, sequence, funding, NULL);
elements_tx_add_fee_output(tx);
tal_resize(&(tx->output_witscripts), tx->wtx->num_outputs);
assert(bitcoin_tx_check(tx));
return tx;