aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-12-10 15:27:53 +0100
committerJaSK <temp@temp.temp>2014-07-02 15:48:38 +0200
commit2935b211033610d7ef0deef9bf1b344a5bac029f (patch)
treec3bb65c391305f127ac89c970eafc9de93ae9d52 /src/qt/walletmodel.cpp
parentc8988460a2865b99ee96da6799d37ac6ccb79d4d (diff)
qt: Hide unspendable outputs in coin control
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index d32e74b78a..098d39e8a7 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -60,7 +60,8 @@ qint64 WalletModel::getBalance(const CCoinControl *coinControl) const
std::vector<COutput> vCoins;
wallet->AvailableCoins(vCoins, true, coinControl);
BOOST_FOREACH(const COutput& out, vCoins)
- nBalance += out.tx->vout[out.i].nValue;
+ if(out.fSpendable)
+ nBalance += out.tx->vout[out.i].nValue;
return nBalance;
}
@@ -585,7 +586,8 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
}
CTxDestination address;
- if(!ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) continue;
+ if(!out.fSpendable || !ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address))
+ continue;
mapCoins[CBitcoinAddress(address).ToString().c_str()].push_back(out);
}
}