From 4ecbd5f1a7ced2c105bbc2ccc9723a9fba874e0e Mon Sep 17 00:00:00 2001 From: niftynei Date: Mon, 22 Jun 2020 15:42:40 -0500 Subject: [PATCH] psbt: use pset initializer if needed we're moving over to elements! --- bitcoin/psbt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitcoin/psbt.c b/bitcoin/psbt.c index a7cabe47f..7e59a940d 100644 --- a/bitcoin/psbt.c +++ b/bitcoin/psbt.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -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);