mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
rpc: call TestBlockValidity via miner interface
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user