partial (missing function GetKeyForDestination) Merge #11403: SegWit wallet support

This commit is contained in:
Konstantin Akimov 2023-08-29 14:39:50 +07:00 committed by PastaPastaPasta
parent 7631118e04
commit fa23a64471
2 changed files with 13 additions and 0 deletions

View File

@ -150,3 +150,13 @@ bool FillableSigningProvider::GetCScript(const CScriptID &hash, CScript& redeemS
}
return false;
}
CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination& dest)
{
// Only supports destinations which map to single public keys, i.e. P2PKH
const PKHash *pkhash = std::get_if<PKHash>(&dest);
if (pkhash != nullptr) return ToKeyID(*pkhash);
return CKeyID();
}

View File

@ -131,4 +131,7 @@ public:
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;
};
/** Return the CKeyID of the key involved in a script (if there is a unique one). */
CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination& dest);
#endif // BITCOIN_SCRIPT_SIGNINGPROVIDER_H