mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 19:52:01 +02:00
Bugfix: make ToPrivateString work with x-only keys
This commit is contained in:
@ -259,7 +259,15 @@ public:
|
||||
bool ToPrivateString(const SigningProvider& arg, std::string& ret) const override
|
||||
{
|
||||
CKey key;
|
||||
if (!arg.GetKey(m_pubkey.GetID(), key)) return false;
|
||||
if (m_xonly) {
|
||||
for (const auto& keyid : XOnlyPubKey(m_pubkey).GetKeyIDs()) {
|
||||
arg.GetKey(keyid, key);
|
||||
if (key.IsValid()) break;
|
||||
}
|
||||
} else {
|
||||
arg.GetKey(m_pubkey.GetID(), key);
|
||||
}
|
||||
if (!key.IsValid()) return false;
|
||||
ret = EncodeSecret(key);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user