Skip to content

Commit 6ba8f30

Browse files
committed
don't attempt mempool entry for wallet transactions on startup if already in mempool
1 parent 24df9af commit 6ba8f30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4114,6 +4114,11 @@ int CMerkleTx::GetBlocksToMaturity() const
41144114

41154115
bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
41164116
{
4117+
// Quick check to avoid re-setting fInMempool to false
4118+
if (mempool.exists(tx->GetHash())) {
4119+
return false;
4120+
}
4121+
41174122
// We must set fInMempool here - while it will be re-set to true by the
41184123
// entered-mempool callback, if we did not there would be a race where a
41194124
// user could call sendmoney in a loop and hit spurious out of funds errors

0 commit comments

Comments
 (0)