mirror of
				https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
				synced 2025-10-30 18:07:22 +00:00 
			
		
		
		
	updated code for global tx
This commit is contained in:
		
							parent
							
								
									60753e1ae2
								
							
						
					
					
						commit
						13ad2b9dea
					
				| @ -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); | ||||
|    | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user