From 1e889eeaf7469fbafb1406c0d693fef0a42f648e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 26 May 2020 13:09:40 +0930 Subject: [PATCH] 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 --- lightningd/peer_control.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 2891365b8..c88075fea 100644 --- a/lightningd/peer_control.c +++ b/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,