From d8a3496b5ad27bea4c79ea0344f595cc1b95f0d3 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Mon, 10 Jun 2024 17:58:13 +0200 Subject: rpc: call TestBlockValidity via miner interface --- src/node/interfaces.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/node') diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index e44cb51873..a528afcff0 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -844,6 +845,12 @@ public: return chainman().GetParams().IsTestChain(); } + bool testBlockValidity(BlockValidationState& state, const CBlock& block, bool check_merkle_root) override + { + LOCK(::cs_main); + return TestBlockValidity(state, chainman().GetParams(), chainman().ActiveChainstate(), block, chainman().ActiveChain().Tip(), /*fCheckPOW=*/false, check_merkle_root); + } + NodeContext* context() override { return &m_node; } ChainstateManager& chainman() { return *Assert(m_node.chainman); } NodeContext& m_node; -- cgit v1.2.3