Skip to content

Commit

Permalink
don't attempt mempool entry for wallet transactions on startup if alr…
Browse files Browse the repository at this point in the history
…eady in mempool
  • Loading branch information
instagibbs authored and furszy committed Feb 24, 2021
1 parent 756d0fa commit 65cf7e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4323,6 +4323,11 @@ bool CWalletTx::IsInMainChainImmature() const

bool CWalletTx::AcceptToMemoryPool(CValidationState& state, bool fLimitFree, bool fRejectInsaneFee, bool ignoreFees)
{
// 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
Expand Down

0 comments on commit 65cf7e1

Please sign in to comment.