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); }