Add logic to track pubkeys as watch-only, not just scripts
This commit is contained in:
@@ -752,10 +752,9 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text)
|
||||
}
|
||||
else // Valid address
|
||||
{
|
||||
CPubKey pubkey;
|
||||
CKeyID keyid;
|
||||
addr.GetKeyID(keyid);
|
||||
if (!model->getPubKey(keyid, pubkey)) // Unknown change address
|
||||
if (!model->havePrivKey(keyid)) // Unknown change address
|
||||
{
|
||||
ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
|
||||
}
|
||||
|
||||
@@ -554,6 +554,11 @@ bool WalletModel::getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const
|
||||
return wallet->GetPubKey(address, vchPubKeyOut);
|
||||
}
|
||||
|
||||
bool WalletModel::havePrivKey(const CKeyID &address) const
|
||||
{
|
||||
return wallet->HaveKey(address);
|
||||
}
|
||||
|
||||
// returns a list of COutputs from COutPoints
|
||||
void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs)
|
||||
{
|
||||
|
||||
@@ -186,6 +186,7 @@ public:
|
||||
UnlockContext requestUnlock();
|
||||
|
||||
bool getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
|
||||
bool havePrivKey(const CKeyID &address) 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;
|
||||
|
||||
Reference in New Issue
Block a user