MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetLastCheckpoint

Function GetLastCheckpoint

src/checkpoints.cpp:17–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace Checkpoints {
16
17 CBlockIndex* GetLastCheckpoint(const CCheckpointData& data)
18 {
19 const MapCheckpoints& checkpoints = data.mapCheckpoints;
20
21 for (const MapCheckpoints::value_type& i : reverse_iterate(checkpoints))
22 {
23 const uint256& hash = i.second;
24 CBlockIndex* pindex = LookupBlockIndex(hash);
25 if (pindex) {
26 return pindex;
27 }
28 }
29 return nullptr;
30 }
31
32} // namespace Checkpoints

Callers 1

Calls 2

reverse_iterateFunction · 0.85
LookupBlockIndexFunction · 0.85

Tested by

no test coverage detected