bitcoin-gui: Implement missing Init::makeMining method
What changed, and why it matters
This commit fixes a simple oversight: the bitcoin-gui program was missing a factory method that creates the 'mining' interface. Because that interface was absent, some internal code paths—such as the waitforblockheight RPC—did not work when running inside bitcoin-gui, even though they worked in bitcoind, bitcoin-qt, and bitcoin-node. The patch adds the missing one-line method and its header include. It is a functionality bug, not an obvious security vulnerability, but any broken RPC path can have downstream reliability or, in rare cases, security-adjacent effects.
Treat as a normal bug-fix commit. Review whether the missing interface caused any assertion, null-dereference, or unexpected RPC behavior that could be triggered by users or automated callers of bitcoin-gui. Consider adding a regression test that exercises waitforblockheight under bitcoin-gui if one does not already exist. No emergency security response is indicated by the diff alone.
Security signals we found
Missing interface factory causing runtime functional failure
RPC method waitforblockheight affected in one binary variant
No input validation, memory corruption, or cryptographic weakness visible in diff
Fix is a direct parity correction with other binaries
Evidence from the diff
In src/init/bitcoin-gui.cpp, the GUI-specific Init subclass did not override interfaces::Init::makeMining(). Other binaries received this override in commit 8ecb6816781c7c7f423b501cbb2de3abd7250119 (#30200), but bitcoin-gui was omitted. The missing override meant callers asking the init object for a Mining interface got a nullptr/default, so code relying on that interface (e.g., waitforblockheight RPC) failed or behaved incorrectly in bitcoin-gui. The fix adds the include for interfaces/mining.h and the one-line override returning interfaces::MakeMining(m_node).
Changed components
src/init/bitcoin-gui.cppinterfaces::Init subclass for bitcoin-guiinterfaces::Mining factorywaitforblockheight RPC (indirectly, via missing interface)Inspect captured patch +2 / −0
diff --git a/src/init/bitcoin-gui.cpp b/src/init/bitcoin-gui.cpp
index 02e8f063..45f623d0 100644
--- a/src/init/bitcoin-gui.cpp
+++ b/src/init/bitcoin-gui.cpp
@@ -7,6 +7,7 @@
#include <interfaces/echo.h>
#include <interfaces/init.h>
#include <interfaces/ipc.h>
+#include <interfaces/mining.h>
#include <interfaces/node.h>
#include <interfaces/rpc.h>
#include <interfaces/wallet.h>
@@ -29,6 +30,7 @@ public:
}
std::unique_ptr<interfaces::Node> makeNode() override { return interfaces::MakeNode(m_node); }
std::unique_ptr<interfaces::Chain> makeChain() override { return interfaces::MakeChain(m_node); }
+ std::unique_ptr<interfaces::Mining> makeMining() override { return interfaces::MakeMining(m_node); }
std::unique_ptr<interfaces::WalletLoader> makeWalletLoader(interfaces::Chain& chain) override
{
return MakeWalletLoader(chain, *Assert(m_node.args));
Why this scored 26/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.