mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
desc spkm: Return SigningProvider only if we have the privkey
If we know about a pubkey that's in our descriptor, but we don't have the private key, don't return a SigningProvider for that pubkey. This is specifically an issue for Taproot outputs that use the H point as the resulting PSBTs may end up containing irrelevant information because the H point was detected as a pubkey each unrelated descriptor knew about.
This commit is contained in:
@@ -2456,7 +2456,11 @@ std::unique_ptr<FlatSigningProvider> DescriptorScriptPubKeyMan::GetSigningProvid
|
||||
int32_t index = it->second;
|
||||
|
||||
// Always try to get the signing provider with private keys. This function should only be called during signing anyways
|
||||
return GetSigningProvider(index, true);
|
||||
std::unique_ptr<FlatSigningProvider> out = GetSigningProvider(index, true);
|
||||
if (!out->HaveKey(pubkey.GetID())) {
|
||||
return nullptr;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::unique_ptr<FlatSigningProvider> DescriptorScriptPubKeyMan::GetSigningProvider(int32_t index, bool include_private) const
|
||||
|
||||
Reference in New Issue
Block a user