mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 16:44:22 +01:00
bitcoin/psbt.c: Add psbt_insert_output function.
This commit is contained in:
committed by
Rusty Russell
parent
e04febfe0c
commit
5d7178d488
@@ -183,6 +183,18 @@ struct wally_psbt_output *psbt_append_output(struct wally_psbt *psbt,
|
||||
wally_tx_output_free(tx_out);
|
||||
return out;
|
||||
}
|
||||
struct wally_psbt_output *psbt_insert_output(struct wally_psbt *psbt,
|
||||
const u8 *script,
|
||||
struct amount_sat amount,
|
||||
size_t insert_at)
|
||||
{
|
||||
struct wally_psbt_output *out;
|
||||
struct wally_tx_output *tx_out = wally_tx_output(script, amount);
|
||||
|
||||
out = psbt_add_output(psbt, tx_out, insert_at);
|
||||
wally_tx_output_free(tx_out);
|
||||
return out;
|
||||
}
|
||||
|
||||
void psbt_rm_output(struct wally_psbt *psbt,
|
||||
size_t remove_at)
|
||||
|
||||
@@ -119,6 +119,10 @@ struct wally_psbt_output *psbt_add_output(struct wally_psbt *psbt,
|
||||
struct wally_psbt_output *psbt_append_output(struct wally_psbt *psbt,
|
||||
const u8 *script,
|
||||
struct amount_sat amount);
|
||||
struct wally_psbt_output *psbt_insert_output(struct wally_psbt *psbt,
|
||||
const u8 *script,
|
||||
struct amount_sat amount,
|
||||
size_t insert_at);
|
||||
|
||||
void psbt_rm_output(struct wally_psbt *psbt,
|
||||
size_t remove_at);
|
||||
|
||||
Reference in New Issue
Block a user