rpc: getblocktemplate getTipHash() via Miner interface

This commit is contained in:
Sjors Provoost
2024-05-30 15:55:02 +02:00
parent d8a3496b5a
commit 404b01c436
3 changed files with 18 additions and 7 deletions

View File

@@ -845,6 +845,14 @@ public:
return chainman().GetParams().IsTestChain();
}
uint256 getTipHash() override
{
LOCK(::cs_main);
CBlockIndex* tip{chainman().ActiveChain().Tip()};
if (!tip) return uint256{0};
return tip->GetBlockHash();
}
bool testBlockValidity(BlockValidationState& state, const CBlock& block, bool check_merkle_root) override
{
LOCK(::cs_main);