From 13ad2b9deafe6999c78238abf7c097733e548d93 Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Wed, 12 Aug 2020 11:33:24 -1000 Subject: [PATCH] updated code for global tx --- src/16_4_createemptypsbt.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/16_4_createemptypsbt.c b/src/16_4_createemptypsbt.c index b820f52..f682e46 100644 --- a/src/16_4_createemptypsbt.c +++ b/src/16_4_createemptypsbt.c @@ -20,8 +20,8 @@ int main(void) { } - struct wally_tx *wtx; - lw_response = wally_tx_init_alloc(0,0,1,1,&wtx); + struct wally_tx *gtx; + lw_response = wally_tx_init_alloc(0,0,1,1,>x); if (lw_response) { @@ -29,23 +29,20 @@ int main(void) { exit(-1); } - - lw_response = wally_tx_clone(wtx, 0, &psbt->tx); + + lw_response = wally_psbt_set_global_tx(psbt,gtx); if (lw_response) { - printf("Error: Wally_tx_clone failed: %d\n",lw_response); + printf("Error: Wally_psbt_set_global_tx failed: %d\n",lw_response); exit(-1); } - psbt->num_inputs = wtx->num_inputs; - psbt->num_outputs = wtx->num_outputs; - wally_tx_free(wtx); - wally_psbt_to_base64(psbt,0,&psbt_64); printf("%s\n",psbt_64); + wally_tx_free(gtx); wally_psbt_free(psbt); }