mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Merge bitcoin/bitcoin#30200: Introduce Mining interface
a9716c53f0rpc: call IsInitialBlockDownload via miner interface (Sjors Provoost)dda0b0834frpc: minize getTipHash() calls in gbt (Sjors Provoost)7b4d3249cerpc: call processNewBlock via miner interface (Sjors Provoost)9e228351e7rpc: getTransactionsUpdated via miner interface (Sjors Provoost)64ebb0f971Always pass options to BlockAssembler constructor (Sjors Provoost)4bf2e361darpc: call CreateNewBlock via miner interface (Sjors Provoost)404b01c436rpc: getblocktemplate getTipHash() via Miner interface (Sjors Provoost)d8a3496b5arpc: call TestBlockValidity via miner interface (Sjors Provoost)8ecb681678Introduce Mining interface (Sjors Provoost) Pull request description: Introduce a `Mining` interface for the `getblocktemplate`, `generateblock` and other mining RPCs to use now, and for Stratum v2 to use later. Suggested here: https://github.com/bitcoin/bitcoin/pull/29346#issuecomment-2108528652 The selection of methods added to the interface is mostly based on what the Template Provider in #29432 uses. It could be expanded further so that `rpc/mining.cpp` no longer needs `EnsureMemPool` and `EnsureChainman`. This PR should be a pure refactor. ACKs for top commit: tdb3: re ACKa9716c53f0itornaza: Code review and std-tests ACKa9716c53f0ryanofsky: Code review ACKa9716c53f0with one minor suggestion in case you update. Only changes since last review were other small changes to the interface. Tree-SHA512: cf97f87d6e9ed89da3835a0730da3b24a7b14c8605ea221149103a5915e79598cf082a95f2bc88e33f1c450e3d4aad88aed1163a29195acca88bcace055af724
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <init/common.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/init.h>
|
||||
#include <interfaces/mining.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <kernel/context.h>
|
||||
#include <key.h>
|
||||
@@ -1117,6 +1118,7 @@ bool AppInitLockDataDirectory()
|
||||
bool AppInitInterfaces(NodeContext& node)
|
||||
{
|
||||
node.chain = node.init->makeChain();
|
||||
node.mining = node.init->makeMining();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user