Skip to content

Commit 6bb9c13

Browse files
committed
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
2 parents 0cc45ed + 6ef86c9 commit 6bb9c13

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,19 +4179,14 @@ int CMerkleTx::GetBlocksToMaturity() const
41794179

41804180
bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
41814181
{
4182-
// Quick check to avoid re-setting fInMempool to false
4183-
if (mempool.exists(tx->GetHash())) {
4184-
return false;
4185-
}
4186-
41874182
// We must set fInMempool here - while it will be re-set to true by the
41884183
// entered-mempool callback, if we did not there would be a race where a
41894184
// user could call sendmoney in a loop and hit spurious out of funds errors
41904185
// because we think that the transaction they just generated's change is
41914186
// unavailable as we're not yet aware its in mempool.
41924187
bool ret = ::AcceptToMemoryPool(mempool, state, tx, nullptr /* pfMissingInputs */,
41934188
nullptr /* plTxnReplaced */, false /* bypass_limits */, nAbsurdFee);
4194-
fInMempool = ret;
4189+
fInMempool |= ret;
41954190
return ret;
41964191
}
41974192

0 commit comments

Comments
 (0)