aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-02-28 15:16:25 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-02-28 15:16:25 -0500
commitf60e49d49c72908356d70d05ae30c6e63be2192d (patch)
tree3fdc2c60417664b6b13005b06085d99472cd250b /src/qt
parent68c97fe11064fbcce891a88c7144b9cf30f2d23e (diff)
parent93a18a3650292afbb441a47d1fa1b94aeb0164e3 (diff)
downloadbitcoin-f60e49d49c72908356d70d05ae30c6e63be2192d.tar.xz
Merge pull request #3694 from gavinandresen/vfspent
Remove CWalletTx::vfSpent
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/coincontroldialog.cpp9
-rw-r--r--src/qt/walletmodel.cpp6
-rw-r--r--src/qt/walletmodel.h1
3 files changed, 12 insertions, 4 deletions
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index e1a9140f45..2d8fcd7a52 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -468,11 +468,12 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
BOOST_FOREACH(const COutput& out, vOutputs)
{
- // unselect already spent, very unlikely scenario, this could happen when selected are spent elsewhere, like rpc or another computer
- if (out.tx->IsSpent(out.i))
+ // unselect already spent, very unlikely scenario, this could happen
+ // when selected are spent elsewhere, like rpc or another computer
+ uint256 txhash = out.tx->GetHash();
+ COutPoint outpt(txhash, out.i);
+ if (model->isSpent(outpt))
{
- uint256 txhash = out.tx->GetHash();
- COutPoint outpt(txhash, out.i);
coinControl->UnSelect(outpt);
continue;
}
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 3549cd49f0..eae448fee4 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -501,6 +501,12 @@ void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vect
}
}
+bool WalletModel::isSpent(const COutPoint& outpoint) const
+{
+ LOCK(wallet->cs_wallet);
+ return wallet->IsSpent(outpoint.hash, outpoint.n);
+}
+
// AvailableCoins + LockedCoins grouped by wallet address (put change in one group with wallet address)
void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const
{
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 91a6fba222..28a9169e27 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -180,6 +180,7 @@ public:
bool getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
+ bool isSpent(const COutPoint& outpoint) const;
void listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const;
bool isLockedCoin(uint256 hash, unsigned int n) const;