Update and rename 16_4_examinepsbt.v to 16_4_examinepsbt.c

This commit is contained in:
Shannon Appelcline 2020-08-11 15:33:05 -10:00 committed by GitHub
parent 233d9b6d2b
commit 06eb11036d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;