From f933c67266cf84a3e0195bd42aacfe702b4731f2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 23 Mar 2016 15:07:30 +0100 Subject: [PATCH] Merge #7715: Fix calculation of balances and available coins. 68d4282 Fix calculation of balances and available coins. (Alex Morcos) --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0ec0a1f0e..622a9b151 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2383,6 +2383,11 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const if (nDepth == 0 && !pcoin->InMempool()) continue; + // We should not consider coins which aren't at least in our mempool + // It's possible for these to be conflicted via ancestors which we may never be able to detect + if (nDepth == 0 && !pcoin->InMempool()) + continue; + for (unsigned int i = 0; i < pcoin->vout.size(); i++) { bool found = false; if(nCoinType == ONLY_DENOMINATED) {