Bitcoin ABC  0.24.7
P2P Digital Currency
psbt.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_NODE_PSBT_H
6 #define BITCOIN_NODE_PSBT_H
7 
8 #include <psbt.h>
9 
10 #include <optional>
11 
17  bool has_utxo;
19  bool is_final;
22 
24  std::vector<CKeyID> missing_pubkeys;
26  std::vector<CKeyID> missing_sigs;
29 };
30 
34 struct PSBTAnalysis {
36  std::optional<size_t> estimated_vsize;
38  std::optional<CFeeRate> estimated_feerate;
40  std::optional<Amount> fee;
42  std::vector<PSBTInputAnalysis> inputs;
46  std::string error;
47 
48  void SetInvalid(std::string err_msg) {
49  estimated_vsize = std::nullopt;
50  estimated_feerate = std::nullopt;
51  fee = std::nullopt;
52  inputs.clear();
54  error = err_msg;
55  }
56 };
57 
66 
67 #endif // BITCOIN_NODE_PSBT_H
PSBTInputAnalysis::missing_pubkeys
std::vector< CKeyID > missing_pubkeys
Pubkeys whose BIP32 derivation path is missing.
Definition: psbt.h:24
psbt.h
PSBTAnalysis
Holds the results of AnalyzePSBT (miscellaneous information about a PSBT)
Definition: psbt.h:34
PSBTAnalysis::inputs
std::vector< PSBTInputAnalysis > inputs
More information about the individual inputs of the transaction.
Definition: psbt.h:42
PSBTInputAnalysis
Holds an analysis of one input from a PSBT.
Definition: psbt.h:15
PSBTAnalysis::next
PSBTRole next
Which of the BIP 174 roles needs to handle the transaction next.
Definition: psbt.h:44
PSBTInputAnalysis::has_utxo
bool has_utxo
Whether we have UTXO information for this input.
Definition: psbt.h:17
PSBTAnalysis::estimated_feerate
std::optional< CFeeRate > estimated_feerate
Estimated feerate (fee / weight) of the transaction.
Definition: psbt.h:38
AnalyzePSBT
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
Provides helpful miscellaneous information about where a PSBT is in the signing workflow.
Definition: psbt.cpp:15
PSBTRole::CREATOR
@ CREATOR
PSBTAnalysis::SetInvalid
void SetInvalid(std::string err_msg)
Definition: psbt.h:48
PSBTInputAnalysis::is_final
bool is_final
Whether the input has all required information including signatures.
Definition: psbt.h:19
uint160
160-bit opaque blob.
Definition: uint256.h:115
PSBTAnalysis::fee
std::optional< Amount > fee
Amount of fee being paid by the transaction.
Definition: psbt.h:40
PSBTInputAnalysis::missing_sigs
std::vector< CKeyID > missing_sigs
Pubkeys whose signatures are missing.
Definition: psbt.h:26
PSBTInputAnalysis::next
PSBTRole next
Which of the BIP 174 roles needs to handle this input next.
Definition: psbt.h:21
PartiallySignedTransaction
A version of CTransaction with the PSBT format.
Definition: psbt.h:335
PSBTRole
PSBTRole
Definition: psbt.h:507
PSBTAnalysis::estimated_vsize
std::optional< size_t > estimated_vsize
Estimated weight of the transaction.
Definition: psbt.h:36
PSBTInputAnalysis::missing_redeem_script
uint160 missing_redeem_script
Hash160 of redeem script, if missing.
Definition: psbt.h:28
PSBTAnalysis::error
std::string error
Error message.
Definition: psbt.h:46