diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2024-05-30 15:55:02 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2024-06-18 18:47:51 +0200 |
commit | 404b01c436122b951e9e06ed26d79dba4651685e (patch) | |
tree | 5186748a7dbc8720724f4a9c5fb6ffd6006250e4 /src/node | |
parent | d8a3496b5ad27bea4c79ea0344f595cc1b95f0d3 (diff) | |
download | bitcoin-404b01c436122b951e9e06ed26d79dba4651685e.tar.xz |
rpc: getblocktemplate getTipHash() via Miner interface
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index a528afcff0..bd200e8d29 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -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); |