aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2024-06-10 17:58:13 +0200
committerSjors Provoost <sjors@sprovoost.nl>2024-06-18 18:47:51 +0200
commitd8a3496b5ad27bea4c79ea0344f595cc1b95f0d3 (patch)
tree0aac30137fb85c4fd26398c43f4b2da75002cdc9 /src/node
parent8ecb6816781c7c7f423b501cbb2de3abd7250119 (diff)
downloadbitcoin-d8a3496b5ad27bea4c79ea0344f595cc1b95f0d3.tar.xz
rpc: call TestBlockValidity 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 e44cb51873..a528afcff0 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -8,6 +8,7 @@
#include <chain.h>
#include <chainparams.h>
#include <common/args.h>
+#include <consensus/validation.h>
#include <deploymentstatus.h>
#include <external_signer.h>
#include <index/blockfilterindex.h>
@@ -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;