aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2017-12-11 10:38:16 -0500
committerMatt Corallo <[email protected]>2017-12-11 10:38:16 -0500
commit6ef86c92e7fcba866160d7a346fb260d7e4ab5bb (patch)
treebbab9b6865a55e61322d19babbdde45919eae972 /src/wallet/wallet.cpp
parentMerge #11839: don't attempt mempool entry for wallet transactions on startup ... (diff)
downloaddiscoin-6ef86c92e7fcba866160d7a346fb260d7e4ab5bb.tar.xz
discoin-6ef86c92e7fcba866160d7a346fb260d7e4ab5bb.zip
Do not un-mark fInMempool on wallet txn if ATMP fails.
Irrespective of the failure reason, un-marking fInMempool out-of-order is incorrect - it should be unmarked when TransactionRemovedFromMempool fires.
Diffstat (limited to 'src/wallet/wallet.cpp')
-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 cb81ec37f..080bfffd5 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4114,11 +4114,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
@@ -4126,6 +4121,6 @@ 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;
}