wallet: unfriend LegacyDataSPKM and DescriptorScriptPubKeyMan classes
What changed, and why it matters
This commit removes a single 'friend' relationship between two wallet classes in Bitcoin Core. It is a code-cleanup change that reduces unnecessary access to private members; it does not fix a bug or vulnerability and has no direct security impact.
No action required; treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change removes friend class LegacyDataSPKM; from DescriptorScriptPubKeyMan. After PR 28333, LegacyDataSPKM no longer needs access to private/protected members of DescriptorScriptPubKeyMan such as AddDescriptorKeyWithDB and TopUpWithDB. This is a defensive encapsulation improvement but is purely refactoring.
Changed components
src/wallet/scriptpubkeyman.hInspect captured patch +0 / −1
diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h
index 35a41939..89f15c8d 100644
--- a/src/wallet/scriptpubkeyman.h
+++ b/src/wallet/scriptpubkeyman.h
@@ -274,7 +274,6 @@ public:
class DescriptorScriptPubKeyMan : public ScriptPubKeyMan
{
- friend class LegacyDataSPKM;
private:
using ScriptPubKeyMap = std::map<CScript, int32_t>; // Map of scripts to descriptor range index
using PubKeyMap = std::map<CPubKey, int32_t>; // Map of pubkeys involved in scripts to descriptor range index
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.