From 6ba8f30e7b0b0bbb365fcca95b0c33af31f28ef4 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 6 Dec 2017 11:49:37 -0500 Subject: don't attempt mempool entry for wallet transactions on startup if already in mempool --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ee1894501c..cb81ec37f5 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4114,6 +4114,11 @@ 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 -- cgit v1.2.3