mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
psbt: add helper to set the non-witness utxo for an input
We need this info for every dual-funded open
This commit is contained in:
parent
7a5a7a0ac5
commit
93045945be
2 changed files with 15 additions and 0 deletions
|
@ -314,6 +314,17 @@ void psbt_input_set_wit_utxo(struct wally_psbt *psbt, size_t in,
|
|||
tal_wally_end(psbt);
|
||||
}
|
||||
|
||||
void psbt_input_set_utxo(struct wally_psbt *psbt, size_t in,
|
||||
const struct wally_tx *prev_tx)
|
||||
{
|
||||
int wally_err;
|
||||
tal_wally_start();
|
||||
wally_err = wally_psbt_input_set_utxo(&psbt->inputs[in],
|
||||
prev_tx);
|
||||
tal_wally_end(psbt);
|
||||
assert(wally_err == WALLY_OK);
|
||||
}
|
||||
|
||||
void psbt_input_set_witscript(struct wally_psbt *psbt, size_t in, const u8 *wscript)
|
||||
{
|
||||
int wally_err;
|
||||
|
|
|
@ -122,6 +122,10 @@ struct wally_psbt_input *psbt_append_input(struct wally_psbt *psbt,
|
|||
void psbt_input_set_wit_utxo(struct wally_psbt *psbt, size_t in,
|
||||
const u8 *scriptPubkey, struct amount_sat amt);
|
||||
|
||||
/* psbt_input_set_utxo - Set the non-witness utxo field for this PSBT input */
|
||||
void psbt_input_set_utxo(struct wally_psbt *psbt, size_t in,
|
||||
const struct wally_tx *prev_tx);
|
||||
|
||||
/* psbt_elements_input_set_asset - Set the asset/value fields for an
|
||||
* Elements PSBT (PSET, technically */
|
||||
void psbt_elements_input_set_asset(struct wally_psbt *psbt, size_t in,
|
||||
|
|
Loading…
Add table
Reference in a new issue