aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
Diffstat (limited to 'src/node')
-rw-r--r--src/node/transaction.cpp27
-rw-r--r--src/node/transaction.h15
2 files changed, 2 insertions, 40 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index 7b9b4310e7..5ffb15ed3c 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -6,38 +6,13 @@
#include <consensus/validation.h>
#include <net.h>
#include <txmempool.h>
+#include <util/validation.h>
#include <validation.h>
#include <validationinterface.h>
#include <node/transaction.h>
#include <future>
-std::string TransactionErrorString(const TransactionError err)
-{
- switch (err) {
- case TransactionError::OK:
- return "No error";
- case TransactionError::MISSING_INPUTS:
- return "Missing inputs";
- case TransactionError::ALREADY_IN_CHAIN:
- return "Transaction already in block chain";
- case TransactionError::P2P_DISABLED:
- return "Peer-to-peer functionality missing or disabled";
- case TransactionError::MEMPOOL_REJECTED:
- return "Transaction rejected by AcceptToMemoryPool";
- case TransactionError::MEMPOOL_ERROR:
- return "AcceptToMemoryPool failed";
- case TransactionError::INVALID_PSBT:
- return "PSBT is not sane";
- case TransactionError::PSBT_MISMATCH:
- return "PSBTs not compatible (different transactions)";
- case TransactionError::SIGHASH_MISMATCH:
- return "Specified sighash value does not match existing value";
- // no default case, so the compiler can warn about missing cases
- }
- assert(false);
-}
-
TransactionError BroadcastTransaction(const CTransactionRef tx, uint256& hashTx, std::string& err_string, const CAmount& highfee)
{
std::promise<void> promise;
diff --git a/src/node/transaction.h b/src/node/transaction.h
index 3457ececa4..51033f94e5 100644
--- a/src/node/transaction.h
+++ b/src/node/transaction.h
@@ -8,20 +8,7 @@
#include <attributes.h>
#include <primitives/transaction.h>
#include <uint256.h>
-
-enum class TransactionError {
- OK, //!< No error
- MISSING_INPUTS,
- ALREADY_IN_CHAIN,
- P2P_DISABLED,
- MEMPOOL_REJECTED,
- MEMPOOL_ERROR,
- INVALID_PSBT,
- PSBT_MISMATCH,
- SIGHASH_MISMATCH,
-};
-
-std::string TransactionErrorString(const TransactionError error);
+#include <util/error.h>
/**
* Broadcast a transaction