diff options
| author | Andrew Chow <[email protected]> | 2019-11-19 14:35:14 -0500 |
|---|---|---|
| committer | Andrew Chow <[email protected]> | 2019-11-19 14:54:08 -0500 |
| commit | 638e40cb6080800c7b0a7f4028f63326acbe4700 (patch) | |
| tree | 05b8025aa1b573e974911096731aac3db2e28af6 /src/node/psbt.h | |
| parent | Merge #17515: Remove straggling OpenSSL references from doc and build (diff) | |
| download | discoin-638e40cb6080800c7b0a7f4028f63326acbe4700.tar.xz discoin-638e40cb6080800c7b0a7f4028f63326acbe4700.zip | |
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.
Diffstat (limited to 'src/node/psbt.h')
| -rw-r--r-- | src/node/psbt.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/node/psbt.h b/src/node/psbt.h index e04366a20..7384dc415 100644 --- a/src/node/psbt.h +++ b/src/node/psbt.h @@ -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; + } }; /** |