MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetLastCheckpoint

Function GetLastCheckpoint

src/checkpoints.cpp:85–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85CBlockIndex* GetLastCheckpoint(const CCheckpointData& data)
86{
87 if (!fEnabled)
88 return NULL;
89
90 const MapCheckpoints& checkpoints = *data.mapCheckpoints;
91
92 for (const MapCheckpoints::value_type& i : reverse_iterate(checkpoints)) {
93 const uint256& hash = i.second;
94 CBlockIndex* pindex = LookupBlockIndex(hash);
95 if (pindex) return pindex;
96 }
97 return NULL;
98}
99
100// Automatically select a suitable sync-checkpoint
101const CBlockIndex* AutoSelectSyncCheckpoint()

Callers 1

Calls 2

reverse_iterateFunction · 0.85
LookupBlockIndexFunction · 0.85

Tested by

no test coverage detected