Changeset View
Changeset View
Standalone View
Standalone View
src/node/psbt.h
Show All 34 Lines | struct PSBTAnalysis { | ||||
//! Estimated feerate (fee / weight) of the transaction | //! Estimated feerate (fee / weight) of the transaction | ||||
Optional<CFeeRate> estimated_feerate; | Optional<CFeeRate> estimated_feerate; | ||||
//! Amount of fee being paid by the transaction | //! Amount of fee being paid by the transaction | ||||
Optional<Amount> fee; | Optional<Amount> fee; | ||||
//! More information about the individual inputs of the transaction | //! More information about the individual inputs of the transaction | ||||
std::vector<PSBTInputAnalysis> inputs; | std::vector<PSBTInputAnalysis> inputs; | ||||
//! Which of the BIP 174 roles needs to handle the transaction next | //! Which of the BIP 174 roles needs to handle the transaction next | ||||
PSBTRole next; | PSBTRole next; | ||||
//! Error message | |||||
std::string error; | |||||
void SetInvalid(std::string err_msg) { | |||||
estimated_vsize = nullopt; | |||||
estimated_feerate = nullopt; | |||||
fee = nullopt; | |||||
inputs.clear(); | |||||
next = PSBTRole::CREATOR; | |||||
error = err_msg; | |||||
} | |||||
}; | }; | ||||
/** | /** | ||||
* Provides helpful miscellaneous information about where a PSBT is in the | * Provides helpful miscellaneous information about where a PSBT is in the | ||||
* signing workflow. | * signing workflow. | ||||
* | * | ||||
* @param[in] psbtx the PSBT to analyze | * @param[in] psbtx the PSBT to analyze | ||||
* @return A PSBTAnalysis with information about the provided PSBT. | * @return A PSBTAnalysis with information about the provided PSBT. | ||||
*/ | */ | ||||
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx); | PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx); | ||||
#endif // BITCOIN_NODE_PSBT_H | #endif // BITCOIN_NODE_PSBT_H |