From 892eff05f115c0b002d0e0b6ffc3ab418480d25c Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 12 Mar 2019 16:08:35 -0700 Subject: [PATCH] Add documentation of struct PSBTAnalysis et al --- src/psbt.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/psbt.h b/src/psbt.h index 0f17a71a4..fcb3337a5 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -557,23 +557,29 @@ enum class PSBTRole { EXTRACTOR }; +/** + * Holds an analysis of one input from a PSBT + */ struct PSBTInputAnalysis { - bool has_utxo; - bool is_final; - PSBTRole next; + bool has_utxo; //!< Whether we have UTXO information for this input + bool is_final; //!< Whether the input has all required information including signatures + PSBTRole next; //!< Which of the BIP 174 roles needs to handle this input next - std::vector missing_pubkeys; - std::vector missing_sigs; - uint160 missing_redeem_script; - uint256 missing_witness_script; + std::vector missing_pubkeys; //!< Pubkeys whose BIP32 derivation path is missing + std::vector missing_sigs; //!< Pubkeys whose signatures are missing + uint160 missing_redeem_script; //!< Hash160 of redeem script, if missing + uint256 missing_witness_script; //!< SHA256 of witness script, if missing }; +/** + * Holds the results of AnalyzePSBT (miscellaneous information about a PSBT) + */ struct PSBTAnalysis { - Optional estimated_vsize; - Optional estimated_feerate; - Optional fee; - std::vector inputs; - PSBTRole next; + Optional estimated_vsize; //!< Estimated weight of the transaction + Optional estimated_feerate; //!< Estimated feerate (fee / weight) of the transaction + Optional fee; //!< Amount of fee being paid by the transaction + std::vector inputs; //!< More information about the individual inputs of the transaction + PSBTRole next; //!< Which of the BIP 174 roles needs to handle the transaction next }; std::string PSBTRoleName(PSBTRole role);