Skip to content

Commit 892eff0

Browse files
committed
Add documentation of struct PSBTAnalysis et al
1 parent ef22fe8 commit 892eff0

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/psbt.h

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -557,23 +557,29 @@ enum class PSBTRole {
557557
EXTRACTOR
558558
};
559559

560+
/**
561+
* Holds an analysis of one input from a PSBT
562+
*/
560563
struct PSBTInputAnalysis {
561-
bool has_utxo;
562-
bool is_final;
563-
PSBTRole next;
564-
565-
std::vector<CKeyID> missing_pubkeys;
566-
std::vector<CKeyID> missing_sigs;
567-
uint160 missing_redeem_script;
568-
uint256 missing_witness_script;
564+
bool has_utxo; //!< Whether we have UTXO information for this input
565+
bool is_final; //!< Whether the input has all required information including signatures
566+
PSBTRole next; //!< Which of the BIP 174 roles needs to handle this input next
567+
568+
std::vector<CKeyID> missing_pubkeys; //!< Pubkeys whose BIP32 derivation path is missing
569+
std::vector<CKeyID> missing_sigs; //!< Pubkeys whose signatures are missing
570+
uint160 missing_redeem_script; //!< Hash160 of redeem script, if missing
571+
uint256 missing_witness_script; //!< SHA256 of witness script, if missing
569572
};
570573

574+
/**
575+
* Holds the results of AnalyzePSBT (miscellaneous information about a PSBT)
576+
*/
571577
struct PSBTAnalysis {
572-
Optional<size_t> estimated_vsize;
573-
Optional<CFeeRate> estimated_feerate;
574-
Optional<CAmount> fee;
575-
std::vector<PSBTInputAnalysis> inputs;
576-
PSBTRole next;
578+
Optional<size_t> estimated_vsize; //!< Estimated weight of the transaction
579+
Optional<CFeeRate> estimated_feerate; //!< Estimated feerate (fee / weight) of the transaction
580+
Optional<CAmount> fee; //!< Amount of fee being paid by the transaction
581+
std::vector<PSBTInputAnalysis> inputs; //!< More information about the individual inputs of the transaction
582+
PSBTRole next; //!< Which of the BIP 174 roles needs to handle the transaction next
577583
};
578584

579585
std::string PSBTRoleName(PSBTRole role);

0 commit comments

Comments
 (0)