mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Qt: Get the private key for signing messages via WalletModel
This commit is contained in:
parent
3cd836c1d8
commit
1880aeb033
@ -142,7 +142,7 @@ void SignVerifyMessageDialog::on_signMessageButton_SM_clicked()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CKey key;
|
CKey key;
|
||||||
if (!pwalletMain->GetKey(keyID, key))
|
if (!model->getPrivKey(keyID, key))
|
||||||
{
|
{
|
||||||
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
|
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
|
||||||
ui->statusLabel_SM->setText(tr("Private key for the entered address is not available."));
|
ui->statusLabel_SM->setText(tr("Private key for the entered address is not available."));
|
||||||
|
@ -563,6 +563,11 @@ bool WalletModel::havePrivKey(const CKeyID &address) const
|
|||||||
return wallet->HaveKey(address);
|
return wallet->HaveKey(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WalletModel::getPrivKey(const CKeyID &address, CKey& vchPrivKeyOut) const
|
||||||
|
{
|
||||||
|
return wallet->GetKey(address, vchPrivKeyOut);
|
||||||
|
}
|
||||||
|
|
||||||
// returns a list of COutputs from COutPoints
|
// returns a list of COutputs from COutPoints
|
||||||
void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs)
|
void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs)
|
||||||
{
|
{
|
||||||
|
@ -188,6 +188,7 @@ public:
|
|||||||
|
|
||||||
bool getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
|
bool getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
|
||||||
bool havePrivKey(const CKeyID &address) const;
|
bool havePrivKey(const CKeyID &address) const;
|
||||||
|
bool getPrivKey(const CKeyID &address, CKey& vchPrivKeyOut) const;
|
||||||
void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
|
void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
|
||||||
bool isSpent(const COutPoint& outpoint) const;
|
bool isSpent(const COutPoint& outpoint) const;
|
||||||
void listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const;
|
void listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user