aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-06-20 17:52:32 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-20 18:00:21 -0700
commitefbcf2b1d5ff4ee7132eae9c9e203d2b875c545b (patch)
treee69e45d22a564b071317fe0a591c158a9b81ac6b /src/validation.cpp
parentb33ca14f594e2cf2a16ef27778169deb7cc9f4dc (diff)
parentd9bec888f1c82f1f58cc821cac81da9c571b5fa5 (diff)
Merge #10503: Use REJECT_DUPLICATE for already known and conflicted txn
d9bec888f Use REJECT_DUPLICATE for already known and conflicted txn (Pieter Wuille) Tree-SHA512: adc6dc5caed731c3fd5c8784e8820a074e320360cdb5579c5b9299f9799dd99de60b7382d336ab1909dab8b23e744456d78aa0c3b1c8dd1af3d1b779314cf8fa
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index bef17337b9..4df5234df4 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -430,8 +430,9 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
return state.DoS(0, false, REJECT_NONSTANDARD, "non-final");
// is it already in the memory pool?
- if (pool.exists(hash))
- return state.Invalid(false, REJECT_ALREADY_KNOWN, "txn-already-in-mempool");
+ if (pool.exists(hash)) {
+ return state.Invalid(false, REJECT_DUPLICATE, "txn-already-in-mempool");
+ }
// Check for conflicts with in-memory transactions
std::set<uint256> setConflicts;
@@ -469,8 +470,9 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
}
}
}
- if (fReplacementOptOut)
- return state.Invalid(false, REJECT_CONFLICT, "txn-mempool-conflict");
+ if (fReplacementOptOut) {
+ return state.Invalid(false, REJECT_DUPLICATE, "txn-mempool-conflict");
+ }
setConflicts.insert(ptxConflicting->GetHash());
}
@@ -497,7 +499,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
if (!had_coin_in_cache) {
coins_to_uncache.push_back(outpoint);
}
- return state.Invalid(false, REJECT_ALREADY_KNOWN, "txn-already-known");
+ return state.Invalid(false, REJECT_DUPLICATE, "txn-already-known");
}
}