Merge pull request #3694 from gavinandresen/vfspent
Remove CWalletTx::vfSpent
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user