aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-14 16:52:35 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-14 16:52:46 +0100
commit6bb9c13f9a2b0ff1328b7605d4b901a646ab35fd (patch)
tree6b723f764f4f9d851bf1b0bf5051c273b4fe9c44
parent0cc45edc0f8a8e8d7569c896e487ff5f8f11c445 (diff)
parent6ef86c92e7fcba866160d7a346fb260d7e4ab5bb (diff)
Merge #11866: Do not un-mark fInMempool on wallet txn if ATMP fails.
6ef86c9 Do not un-mark fInMempool on wallet txn if ATMP fails. (Matt Corallo) Pull request description: Irrespective of the failure reason, un-marking fInMempool out-of-order is incorrect - it should be unmarked when TransactionRemovedFromMempool fires. Clean up of #11839, which I think was the wrong fix. Tree-SHA512: 580731297eeac4c4c99ec695e15b09febf62249237bc367fcd1830fc811d3166f9336e7aba7f2f6f8601960984ae22cebed781200db0f04e7cd2008db1a83f64
-rw-r--r--src/wallet/wallet.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 513819606b..a57c472126 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4179,11 +4179,6 @@ int CMerkleTx::GetBlocksToMaturity() const
bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
{
- // Quick check to avoid re-setting fInMempool to false
- if (mempool.exists(tx->GetHash())) {
- return false;
- }
-
// We must set fInMempool here - while it will be re-set to true by the
// entered-mempool callback, if we did not there would be a race where a
// user could call sendmoney in a loop and hit spurious out of funds errors
@@ -4191,7 +4186,7 @@ bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState&
// unavailable as we're not yet aware its in mempool.
bool ret = ::AcceptToMemoryPool(mempool, state, tx, nullptr /* pfMissingInputs */,
nullptr /* plTxnReplaced */, false /* bypass_limits */, nAbsurdFee);
- fInMempool = ret;
+ fInMempool |= ret;
return ret;
}