mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 20:20:00 +01:00
Merge bitcoin/bitcoin#31242: wallet, desc spkm: Return SigningProvider only if we have the privkey
f6a6d91205test: add check for getting SigningProvider for a CPubKey (Sebastian Falbesoner)62a95f5af9test: refactor: move `CreateDescriptor` helper to wallet test util module (Sebastian Falbesoner)493656763fdesc spkm: Return SigningProvider only if we have the privkey (Ava Chow) Pull request description: 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. Split from #29675 ACKs for top commit: fjahr: ACKf6a6d91205theStack: re-ACKf6a6d91205furszy: utACKf6a6d91205. Only reviewed the actual change in detail, not the test commit. Tree-SHA512: 30a196e611a0c5d9ebe5baf6d896caaa6af66f1615463dbb0c31e52604d53cf342922bb9967b3c697b47083d76b0485c77a5f545bd6381247c8bc44321c70f97
This commit is contained in:
@@ -2468,7 +2468,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