aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-02-14 14:40:32 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-02-14 14:40:32 -0500
commit05d3ded072d782036c31c1d773c0441b87de843e (patch)
tree1dcdec2f37f61415aa5d1b71da101e0cfbd035fd /src/qt/walletmodel.cpp
parente051e65c219cc72a2bba768f3d5e043ad055b48e (diff)
parent9a3d936fc2e98b1e8234bf27e09cf7bc22811bee (diff)
downloadbitcoin-05d3ded072d782036c31c1d773c0441b87de843e.tar.xz
Merge pull request #3669 from gavinandresen/dead_txns
Handle "conflicted" transactions properly
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index ddc8c6ea79..fabe292b44 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -494,7 +494,9 @@ void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vect
BOOST_FOREACH(const COutPoint& outpoint, vOutpoints)
{
if (!wallet->mapWallet.count(outpoint.hash)) continue;
- COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, wallet->mapWallet[outpoint.hash].GetDepthInMainChain());
+ int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain();
+ if (nDepth < 0) continue;
+ COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth);
vOutputs.push_back(out);
}
}
@@ -513,7 +515,9 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
BOOST_FOREACH(const COutPoint& outpoint, vLockedCoins)
{
if (!wallet->mapWallet.count(outpoint.hash)) continue;
- COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, wallet->mapWallet[outpoint.hash].GetDepthInMainChain());
+ int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain();
+ if (nDepth < 0) continue;
+ COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth);
vCoins.push_back(out);
}