Introduce Mining interface

Start out with a single method isTestChain() that's used by the getblocktemplate RPC.
This commit is contained in:
Sjors Provoost
2024-06-07 11:22:44 +02:00
parent 9c5cdf07f3
commit 8ecb681678
14 changed files with 85 additions and 3 deletions

View File

@@ -101,6 +101,14 @@ CConnman& EnsureConnman(const NodeContext& node)
return *node.connman;
}
interfaces::Mining& EnsureMining(const NodeContext& node)
{
if (!node.mining) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Node miner not found");
}
return *node.mining;
}
PeerManager& EnsurePeerman(const NodeContext& node)
{
if (!node.peerman) {