Browse Source

lightningd: have sign_last_tx populate the input amounts.

With this change, all bitcoin_tx we send across the wire have
their inputs_amounts populated.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
nifty/pset-pre
Rusty Russell 5 years ago
parent
commit
1e889eeaf7
  1. 8
      lightningd/peer_control.c

8
lightningd/peer_control.c

@ -184,7 +184,13 @@ static void sign_last_tx(struct channel *channel)
u8 *msg, **witness;
assert(!channel->last_tx->wtx->inputs[0].witness);
/* Attach input amount, to complete transaction for marshaling */
if (!channel->last_tx->input_amounts[0]) {
channel->last_tx->input_amounts[0]
= tal_dup(channel->last_tx->input_amounts,
struct amount_sat,
&channel->funding);
}
msg = towire_hsm_sign_commitment_tx(tmpctx,
&channel->peer->id,
channel->dbid,

Loading…
Cancel
Save