aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2017-12-06 11:49:37 -0500
committerGregory Sanders <gsanders87@gmail.com>2017-12-11 09:08:54 -0500
commit6ba8f30e7b0b0bbb365fcca95b0c33af31f28ef4 (patch)
treeedab14e647c5909e1d84983250869b2db5632f5f /src/wallet/wallet.cpp
parent24df9af81625122c816a0ae6bb842ea47a4041ff (diff)
downloadbitcoin-6ba8f30e7b0b0bbb365fcca95b0c33af31f28ef4.tar.xz
don't attempt mempool entry for wallet transactions on startup if already in mempool
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp5
1 files changed, 5 insertions, 0 deletions
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