mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge #17371: Refactor: Require scriptPubKey to get wallet SigningProvider
d0dab897afRefactor: Require scriptPubKey to get wallet SigningProvider (Andrew Chow)4b0c718f8fAccumulate result UniValue in SignTransaction (Andrew Chow) Pull request description: Easier to review ignoring whitespace: git log -p -n1 -w This commit does not change behavior. It passes new CScript arguments to signing functions, but the arguments aren't currently used. Split from #17261 ACKs for top commit: instagibbs: utACKd0dab897afryanofsky: Code review ACKd0dab897af. Thanks for the SignTransaction update. No other changes since last review Sjors: Code review ACKd0dab897afpromag: Code review ACKd0dab897af. meshcollider: Code review ACKd0dab897afTree-SHA512: c3f52df20fd9d6b3b5aa65562cf5f7dce7b7f44c148b0f988f8b578fce2a28e9b7bf010f5f04bb5bf60f5272b2899f1dbbfb8aee81579c21c9cba559d1d2bb70
This commit is contained in:
@@ -116,8 +116,22 @@ public:
|
||||
std::string error;
|
||||
return m_wallet->GetNewDestination(type, label, dest, error);
|
||||
}
|
||||
bool getPubKey(const CKeyID& address, CPubKey& pub_key) override { return m_wallet->GetLegacyScriptPubKeyMan()->GetPubKey(address, pub_key); }
|
||||
bool getPrivKey(const CKeyID& address, CKey& key) override { return m_wallet->GetLegacyScriptPubKeyMan()->GetKey(address, key); }
|
||||
bool getPubKey(const CScript& script, const CKeyID& address, CPubKey& pub_key) override
|
||||
{
|
||||
const SigningProvider* provider = m_wallet->GetSigningProvider(script);
|
||||
if (provider) {
|
||||
return provider->GetPubKey(address, pub_key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool getPrivKey(const CScript& script, const CKeyID& address, CKey& key) override
|
||||
{
|
||||
const SigningProvider* provider = m_wallet->GetSigningProvider(script);
|
||||
if (provider) {
|
||||
return provider->GetKey(address, key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool isSpendable(const CTxDestination& dest) override { return m_wallet->IsMine(dest) & ISMINE_SPENDABLE; }
|
||||
bool haveWatchOnly() override
|
||||
{
|
||||
|
||||
@@ -81,10 +81,10 @@ public:
|
||||
virtual bool getNewDestination(const OutputType type, const std::string label, CTxDestination& dest) = 0;
|
||||
|
||||
//! Get public key.
|
||||
virtual bool getPubKey(const CKeyID& address, CPubKey& pub_key) = 0;
|
||||
virtual bool getPubKey(const CScript& script, const CKeyID& address, CPubKey& pub_key) = 0;
|
||||
|
||||
//! Get private key.
|
||||
virtual bool getPrivKey(const CKeyID& address, CKey& key) = 0;
|
||||
virtual bool getPrivKey(const CScript& script, const CKeyID& address, CKey& key) = 0;
|
||||
|
||||
//! Return whether wallet has private key.
|
||||
virtual bool isSpendable(const CTxDestination& dest) = 0;
|
||||
|
||||
Reference in New Issue
Block a user