aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-04-28 16:26:31 -0500
committerJohn Newbery <john@johnnewbery.com>2019-10-29 15:46:45 -0400
commit3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf (patch)
tree2d4d4423e4283cbf93406d016baf2ace0b519bc3 /src/node
parentc428622a5bb1e37b2e6ab2c52791ac05d9271238 (diff)
[validation] Remove fMissingInputs from AcceptToMemoryPool()
Handle this failure in the same way as all other failures: call Invalid() with the reasons for the failure.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/transaction.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index 4645baa3d7..8989a77e57 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -37,17 +37,15 @@ TransactionError BroadcastTransaction(const CTransactionRef tx, std::string& err
if (!mempool.exists(hashTx)) {
// Transaction is not already in the mempool. Submit it.
TxValidationState state;
- bool fMissingInputs;
- if (!AcceptToMemoryPool(mempool, state, std::move(tx), &fMissingInputs,
+ 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;
}
}