mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
psbt: use pset initializer if needed
we're moving over to elements!
This commit is contained in:
parent
389bd8393b
commit
4ecbd5f1a7
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <assert.h>
|
||||
#include <bitcoin/chainparams.h>
|
||||
#include <bitcoin/psbt.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <bitcoin/script.h>
|
||||
|
@ -47,7 +48,10 @@ struct wally_psbt *new_psbt(const tal_t *ctx, const struct wally_tx *wtx)
|
|||
size_t *script_lens;
|
||||
struct wally_tx_witness_stack **witnesses;
|
||||
|
||||
wally_err = wally_psbt_init_alloc(wtx->num_inputs, wtx->num_outputs, 0, &psbt);
|
||||
if (is_elements(chainparams))
|
||||
wally_err = wally_psbt_elements_init_alloc(wtx->num_inputs, wtx->num_outputs, 0, &psbt);
|
||||
else
|
||||
wally_err = wally_psbt_init_alloc(wtx->num_inputs, wtx->num_outputs, 0, &psbt);
|
||||
assert(wally_err == WALLY_OK);
|
||||
tal_add_destructor(psbt, psbt_destroy);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue