diff --git a/src/psbt.h b/src/psbt.h index f0de079f7b4..2e7fe964fd0 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -468,7 +468,8 @@ struct PSBTInput // Read loop bool found_sep = false; while(!s.empty()) { - // Read + // Read the key of format "" after which + // "key" will contain "" std::vector key; s >> key; @@ -479,11 +480,13 @@ struct PSBTInput break; } - // Type is compact size uint at beginning of key + // "skey" is used so that "key" is unchanged after reading keytype below SpanReader skey{key}; + // keytype is of the format compact size uint at the beginning of "key" uint64_t type = ReadCompactSize(skey); - // Do stuff based on type + // Do stuff based on keytype "type", i.e., key checks, reading values of the + // format "" from the stream "s", and value checks switch(type) { case PSBT_IN_NON_WITNESS_UTXO: { @@ -957,7 +960,8 @@ struct PSBTOutput // Read loop bool found_sep = false; while(!s.empty()) { - // Read + // Read the key of format "" after which + // "key" will contain "" std::vector key; s >> key; @@ -968,11 +972,13 @@ struct PSBTOutput break; } - // Type is compact size uint at beginning of key + // "skey" is used so that "key" is unchanged after reading keytype below SpanReader skey{key}; + // keytype is of the format compact size uint at the beginning of "key" uint64_t type = ReadCompactSize(skey); - // Do stuff based on type + // Do stuff based on keytype "type", i.e., key checks, reading values of the + // format "" from the stream "s", and value checks switch(type) { case PSBT_OUT_REDEEMSCRIPT: { @@ -1220,7 +1226,8 @@ struct PartiallySignedTransaction // Read global data bool found_sep = false; while(!s.empty()) { - // Read + // Read the key of format "" after which + // "key" will contain "" std::vector key; s >> key; @@ -1231,11 +1238,13 @@ struct PartiallySignedTransaction break; } - // Type is compact size uint at beginning of key + // "skey" is used so that "key" is unchanged after reading keytype below SpanReader skey{key}; + // keytype is of the format compact size uint at the beginning of "key" uint64_t type = ReadCompactSize(skey); - // Do stuff based on type + // Do stuff based on keytype "type", i.e., key checks, reading values of the + // format "" from the stream "s", and value checks switch(type) { case PSBT_GLOBAL_UNSIGNED_TX: {