Remove checkpoints

The headers presync logic should be enough to prevent memory DoS using
low-work headers. Therefore, we no longer have any use for checkpoints.
This commit is contained in:
marcofleon
2025-01-13 15:08:41 +00:00
parent 632ae47372
commit 3c5d1a4681
18 changed files with 10 additions and 731 deletions

View File

@@ -38,7 +38,6 @@
#include <cstddef>
#include <map>
#include <ranges>
#include <unordered_map>
namespace kernel {
@@ -576,20 +575,6 @@ void BlockManager::ScanAndUnlinkAlreadyPrunedFiles()
UnlinkPrunedFiles(block_files_to_prune);
}
const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data)
{
const MapCheckpoints& checkpoints = data.mapCheckpoints;
for (const MapCheckpoints::value_type& i : checkpoints | std::views::reverse) {
const uint256& hash = i.second;
const CBlockIndex* pindex = LookupBlockIndex(hash);
if (pindex) {
return pindex;
}
}
return nullptr;
}
bool BlockManager::IsBlockPruned(const CBlockIndex& block) const
{
AssertLockHeld(::cs_main);