From 06eb11036d596be2b6a7694370e672303e9077b1 Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Tue, 11 Aug 2020 15:33:05 -1000 Subject: [PATCH] Update and rename 16_4_examinepsbt.v to 16_4_examinepsbt.c --- src/{16_4_examinepsbt.v => 16_4_examinepsbt.c} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename src/{16_4_examinepsbt.v => 16_4_examinepsbt.c} (90%) diff --git a/src/16_4_examinepsbt.v b/src/16_4_examinepsbt.c similarity index 90% rename from src/16_4_examinepsbt.v rename to src/16_4_examinepsbt.c index 887a619..66b48a2 100644 --- a/src/16_4_examinepsbt.v +++ b/src/16_4_examinepsbt.c @@ -4,7 +4,6 @@ int main(int argc, char *argv[]) { - /* 1. Request a PSBT */ if (argc != 2) { @@ -35,6 +34,8 @@ int main(int argc, char *argv[]) { int inputs = psbt->num_inputs; printf("TOTAL INPUTS: %i\n",inputs); + /* This will crash if the inputs are not filled in, or if there are non_witness_utxos */ + for (int i = 0 ; i < inputs ; i++) { printf("\nINPUT #%i: %i satoshis\n",i, psbt->inputs[i].witness_utxo->satoshi); @@ -49,6 +50,9 @@ int main(int argc, char *argv[]) { int outputs = psbt->num_outputs; printf("\nTOTAL OUTPUTS: %i\n",outputs); + + /* This will crash if the outputs are not filled in */ + for (int i = 0 ; i < outputs ; i++) { char *pubkey_hex;