interfaces: move getTip implementation to miner
This commit is contained in:
1 parent
720f201e65
commit
c39ca9d4f7
3 files changed
+15
-4
No files matched your search
@@ -539,4 +539,12 @@ std::unique_ptr<CBlockTemplate> WaitAndCreateNewBlock(ChainstateManager& chainma
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::optional<BlockRef> GetTip(ChainstateManager& chainman)
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
CBlockIndex* tip{chainman.ActiveChain().Tip()};
|
||||
if (!tip) return {};
|
||||
return BlockRef{tip->GetBlockHash(), tip->nHeight};
|
||||
}
|
||||
} // namespace node
|
||||
Reference in new issue
Block a user