From 2055b53425f26892579607904dba3b303d9325a8 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 21 May 2020 11:27:00 +0930 Subject: [PATCH] psbt: update global tx output amount also --- bitcoin/tx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index b6ecf08a9..b1e2bdf28 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -217,6 +217,10 @@ void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum, assert(ret == WALLY_OK); } else { output->satoshi = satoshis; + + /* update the global tx for the psbt also */ + output = &tx->psbt->tx->outputs[outnum]; + output->satoshi = satoshis; } }