updated code for global tx

This commit is contained in:
Shannon Appelcline 2020-08-12 11:33:24 -10:00 committed by GitHub
parent 60753e1ae2
commit 13ad2b9dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,&gtx);
if (lw_response) {
@ -30,22 +30,19 @@ int main(void) {
}
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);
}