mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-25 21:39:05 +01:00
common: Add PSBTError enum
Add separate PSBTError enum instead of reusing TransactionError enum for PSBT operations, and drop unused error codes. The error codes returned by PSBT operations and transaction broadcast functions mostly do not overlap, so using an unified enum makes it harder to call any of these functions and know which errors actually need to be handled. Define PSBTError in the common library because PSBT functionality is implemented in the common library and used by both the node (for rawtransaction RPCs) and the wallet.
This commit is contained in:
@@ -37,6 +37,9 @@ enum class OutputType;
|
||||
enum class TransactionError;
|
||||
struct FlatSigningProvider;
|
||||
struct bilingual_str;
|
||||
namespace common {
|
||||
enum class PSBTError;
|
||||
} // namespace common
|
||||
|
||||
static constexpr bool DEFAULT_RPC_DOC_CHECK{
|
||||
#ifdef RPC_DOC_CHECK
|
||||
@@ -128,6 +131,7 @@ int ParseSighashString(const UniValue& sighash);
|
||||
unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target);
|
||||
|
||||
RPCErrorCode RPCErrorFromTransactionError(TransactionError terr);
|
||||
UniValue JSONRPCPSBTError(common::PSBTError err);
|
||||
UniValue JSONRPCTransactionError(TransactionError terr, const std::string& err_string = "");
|
||||
|
||||
//! Parse a JSON range specified as int64, or [int64, int64]
|
||||
|
||||
Reference in New Issue
Block a user