mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
txprepare, withdraw: return the PSBT as well as raw tx.
In particular, txprepare gives us a nice way to get a valid PSBT for testing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `txprepare` and `withdraw` now return a `psbt` field.
This commit is contained in:
@@ -138,6 +138,7 @@ static struct command_result *sendpsbt_done(struct command *cmd,
|
||||
out = jsonrpc_stream_success(cmd);
|
||||
json_add_hex_talarr(out, "tx", linearize_wtx(tmpctx, utx->tx));
|
||||
json_add_txid(out, "txid", &utx->txid);
|
||||
json_add_psbt(out, "psbt", utx->psbt);
|
||||
return command_finished(cmd, out);
|
||||
}
|
||||
|
||||
@@ -222,6 +223,7 @@ static struct command_result *finish_txprepare(struct command *cmd,
|
||||
out = jsonrpc_stream_success(cmd);
|
||||
json_add_hex_talarr(out, "unsigned_tx", linearize_wtx(tmpctx, utx->tx));
|
||||
json_add_txid(out, "txid", &utx->txid);
|
||||
json_add_psbt(out, "psbt", utx->psbt);
|
||||
return command_finished(cmd, out);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user