| 83 | } |
| 84 | |
| 85 | CBlockIndex* 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 |
| 101 | const CBlockIndex* AutoSelectSyncCheckpoint() |
no test coverage detected