aboutsummaryrefslogtreecommitdiff
path: root/src/node/transaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/transaction.cpp')
-rw-r--r--src/node/transaction.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index ba4f3c5370..2da3ecd8e3 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -37,18 +37,16 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
}
if (!mempool.exists(hashTx)) {
// Transaction is not already in the mempool. Submit it.
- CValidationState state;
- bool fMissingInputs;
- if (!AcceptToMemoryPool(mempool, state, std::move(tx), &fMissingInputs,
+ TxValidationState state;
+ if (!AcceptToMemoryPool(mempool, state, std::move(tx),
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_tx_fee)) {
+ err_string = FormatStateMessage(state);
if (state.IsInvalid()) {
- err_string = FormatStateMessage(state);
- return TransactionError::MEMPOOL_REJECTED;
- } else {
- if (fMissingInputs) {
+ if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
return TransactionError::MISSING_INPUTS;
}
- err_string = FormatStateMessage(state);
+ return TransactionError::MEMPOOL_REJECTED;
+ } else {
return TransactionError::MEMPOOL_ERROR;
}
}