aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2024-06-10 17:03:33 +0200
committerSjors Provoost <sjors@sprovoost.nl>2024-06-18 18:47:51 +0200
commit4bf2e361da1964f7c278b4939967a0e5afde20b0 (patch)
treeea724943b5c9af260bd631da0bacaa5755c862ef /src/node
parent404b01c436122b951e9e06ed26d79dba4651685e (diff)
rpc: call CreateNewBlock via miner interface
Diffstat (limited to 'src/node')
-rw-r--r--src/node/interfaces.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index bd200e8d29..215dbf5e17 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -32,6 +32,7 @@
#include <node/context.h>
#include <node/interface_ui.h>
#include <node/mini_miner.h>
+#include <node/miner.h>
#include <node/transaction.h>
#include <node/types.h>
#include <node/warnings.h>
@@ -859,6 +860,12 @@ public:
return TestBlockValidity(state, chainman().GetParams(), chainman().ActiveChainstate(), block, chainman().ActiveChain().Tip(), /*fCheckPOW=*/false, check_merkle_root);
}
+ std::unique_ptr<CBlockTemplate> createNewBlock(const CScript& script_pub_key, bool use_mempool) override
+ {
+ LOCK(::cs_main);
+ return BlockAssembler{chainman().ActiveChainstate(), use_mempool ? context()->mempool.get() : nullptr}.CreateNewBlock(script_pub_key);
+ }
+
NodeContext* context() override { return &m_node; }
ChainstateManager& chainman() { return *Assert(m_node.chainman); }
NodeContext& m_node;