mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
bitcoin/tx: (optional) input amount.
We need this for signing segwitness txs. Unfortunately, we don't have it for transactions we received as hex, only ones we created; to make this safe we use a pointer which is NULL if we don't know, and those will crash if we try to sign or check their sigs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -56,6 +56,7 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx,
|
||||
/* Our input spends the anchor tx output. */
|
||||
tx->input[0].txid = *anchor_txid;
|
||||
tx->input[0].index = anchor_index;
|
||||
tx->input[0].amount = tal_dup(tx->input, u64, &anchor_satoshis);
|
||||
|
||||
/* First output is a P2SH to a complex redeem script (usu. for me) */
|
||||
redeemscript = bitcoin_redeem_secret_or_delay(tx, our_final,
|
||||
|
||||
Reference in New Issue
Block a user