mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
interfaces: move getTip implementation to miner
This commit is contained in:
committed by
ismaelsadeeq
parent
720f201e65
commit
c39ca9d4f7
@@ -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