txprepare: elements requires inclusion of an accurate fee output

so we add an accurate one
This commit is contained in:
niftynei
2020-09-09 17:38:12 -05:00
committed by Rusty Russell
parent 65f01d8180
commit 4c28e7b362
3 changed files with 57 additions and 0 deletions

View File

@@ -191,6 +191,10 @@ static struct command_result *finish_txprepare(struct command *cmd,
psbt_add_output(txp->psbt, out, i);
}
/* If this is elements, we should normalize
* the PSBT fee output */
psbt_elements_normalize_fees(txp->psbt);
utx = tal(NULL, struct unreleased_tx);
utx->psbt = tal_steal(utx, txp->psbt);
psbt_txid(txp->psbt, &utx->txid, &utx->tx);