mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02:00
Replace GetSigningProvider with GetSolvingProvider
Not all ScriptPubKeyMans will be able to provide private keys, but pubkeys and scripts should be. So only provide public-only SigningProviders, i.e. ones that can help with Solving.
This commit is contained in:
@@ -118,20 +118,12 @@ public:
|
||||
}
|
||||
bool getPubKey(const CScript& script, const CKeyID& address, CPubKey& pub_key) override
|
||||
{
|
||||
std::unique_ptr<SigningProvider> provider = m_wallet->GetSigningProvider(script);
|
||||
std::unique_ptr<SigningProvider> provider = m_wallet->GetSolvingProvider(script);
|
||||
if (provider) {
|
||||
return provider->GetPubKey(address, pub_key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool getPrivKey(const CScript& script, const CKeyID& address, CKey& key) override
|
||||
{
|
||||
std::unique_ptr<SigningProvider> provider = m_wallet->GetSigningProvider(script);
|
||||
if (provider) {
|
||||
return provider->GetKey(address, key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
SigningResult signMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) override
|
||||
{
|
||||
return m_wallet->SignMessage(message, pkhash, str_sig);
|
||||
|
||||
@@ -85,9 +85,6 @@ public:
|
||||
//! Get public key.
|
||||
virtual bool getPubKey(const CScript& script, const CKeyID& address, CPubKey& pub_key) = 0;
|
||||
|
||||
//! Get private key.
|
||||
virtual bool getPrivKey(const CScript& script, const CKeyID& address, CKey& key) = 0;
|
||||
|
||||
//! Sign message
|
||||
virtual SigningResult signMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user