init refactor: Remove node.init accesss in AppInitInterfaces
What changed, and why it matters
This is a small internal code cleanup in Bitcoin Core's startup code. It changes how two internal interfaces (chain and mining) are created, using direct function calls instead of going through an intermediate 'init' object. The commit message explicitly states there is no change in behavior, and the diff shows only two lines changed in a straightforward way. There is no security issue visible here.
No security action needed. Treat as normal code refactoring during review.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/init.cpp, AppInitInterfaces previously obtained node.chain and node.mining via node.init->makeChain() and node.init->makeMining(). The patch replaces these with direct calls to interfaces::MakeChain(node) and interfaces::MakeMining(node). This removes node.init access from AppInitInterfaces to avoid a layering violation: node.init is meant to provide interface pointers to external clients (wallet/GUI), not for the node’s own internal initialization. The commit message frames this as pure refactoring with no behavioral change, preparatory work for a future MakeMining wait_loaded option.
Changed components
src/init.cppAppInitInterfacesnode.chain initializationnode.mining initializationInspect captured patch +2 / −2
diff --git a/src/init.cpp b/src/init.cpp
index adc1dacc..bdff6863 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1206,8 +1206,8 @@ bool AppInitLockDirectories()
bool AppInitInterfaces(NodeContext& node)
{
- node.chain = node.init->makeChain();
- node.mining = node.init->makeMining();
+ node.chain = interfaces::MakeChain(node);
+ node.mining = interfaces::MakeMining(node);
return true;
}
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.