diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-12-11 16:12:06 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-12-11 16:21:03 +0100 |
commit | 8ab6c0b09e4e734e3033d81fe0a25f09ca74ba26 (patch) | |
tree | f4ba8871dd80ea318b6e7820f5018cf023826c8b /src/wallet/wallet.cpp | |
parent | f60b4ad57912b78a96af08046a503f7905610a8c (diff) | |
parent | 6697a7089441deded836332e7ce3b4a1a9a3cbcd (diff) |
Merge #11839: don't attempt mempool entry for wallet transactions on startup if alr…
6697a70 add test for unconfirmed balance between restarts (Gregory Sanders)
6ba8f30 don't attempt mempool entry for wallet transactions on startup if already in mempool (Gregory Sanders)
Pull request description:
…eady in mempool
Mempool loads first, wallet second. Second attempt fails, marking that transaction !fInMempool. Those funds will disappear until confirmation is reached.
Tree-SHA512: 955f0565ec1dc1ba395e0b803a98c07b7cd00c8cac5ec618ed832fed259a856fb7bbbe41310cf6a4e43c0435e09b156109d2a4467d403811dc8379d2caebeede
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 5 |
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 |