fundpsbt: new JSON API to gather UTXOs.

Technically, they could do this themselves, but it's much nicer to have one
place to do it (and it makes sure we get the required information into the
PSBT, which is actually not entirely accessible through listfunds, as that
doesn't want to consult with the HSM for close outputs).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON RPC: new low-level coin selection `fundpsbt` routine.
This commit is contained in:
Rusty Russell
2020-07-15 15:04:49 +09:30
parent 4ee527a59c
commit bd19ec2292
3 changed files with 139 additions and 1 deletions

View File

@@ -76,7 +76,6 @@ struct bitcoin_tx *tx_spending_utxos(const tal_t *ctx,
struct pubkey key;
u8 *scriptSig, *scriptPubkey, *redeemscript;
assert(num_output);
size_t outcount = add_change_output ? 1 + num_output : num_output;
struct bitcoin_tx *tx = bitcoin_tx(ctx, chainparams, tal_count(utxos),
outcount, nlocktime);