mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user