mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-04 17:52:25 +01:00
Have a PSBTAnalysis state that indicates invalid PSBT
Invalid PSBTs need to be re-created, so the next role is the Creator (new PSBTRole). Additionally, we need to know what went wrong so an error field was added to PSBTAnalysis. A PSBTAnalysis indicating invalid will have empty everything, next will be set to PSBTRole::CREATOR, and an error message.
This commit is contained in:
@@ -30,6 +30,17 @@ struct PSBTAnalysis {
|
||||
Optional<CAmount> fee; //!< Amount of fee being paid by the transaction
|
||||
std::vector<PSBTInputAnalysis> 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 error; //!< Error message
|
||||
|
||||
void SetInvalid(std::string err_msg)
|
||||
{
|
||||
estimated_vsize = nullopt;
|
||||
estimated_feerate = nullopt;
|
||||
fee = nullopt;
|
||||
inputs.clear();
|
||||
next = PSBTRole::CREATOR;
|
||||
error = err_msg;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user