Disable sync checkpoint system that blocks IBD
The sync checkpoint (hashSyncCheckpoint) was persisted in LevelDB pointing to block 2,186,940. On startup it was loaded from DB, overriding any code change to the initial value. CheckSync then rejected every block below that height during IBD since they weren't in mapBlockIndex yet. Three-pronged fix: - CheckSync now always returns true (master key disabled, no new sync checkpoints will ever be broadcast) - AcceptBlock no longer calls sync checkpoint enforcement - LoadBlockIndex resets sync checkpoint to genesis if stored hash is not in the block index (prevents assert crash) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-12
@@ -2471,18 +2471,10 @@ bool CBlock::AcceptBlock()
|
||||
}
|
||||
}
|
||||
|
||||
// Before fork: enforce sync checkpoints for historical chain integrity
|
||||
// After fork: no sync checkpoint enforcement (decentralized)
|
||||
if (nHeight < FORK_HEIGHT_V5)
|
||||
{
|
||||
bool cpSatisfies = Checkpoints::CheckSync(hash, pindexPrev);
|
||||
|
||||
if (CheckpointsMode == Checkpoints::STRICT && !cpSatisfies)
|
||||
return error("AcceptBlock() : rejected by synchronized checkpoint");
|
||||
|
||||
if (CheckpointsMode == Checkpoints::ADVISORY && !cpSatisfies)
|
||||
strMiscWarning = _("WARNING: syncronized checkpoint violation detected, but skipped!");
|
||||
}
|
||||
// Sync checkpoint enforcement is disabled:
|
||||
// - Master key was removed in V5 fork, no new sync checkpoints will be broadcast
|
||||
// - Hardcoded checkpoints already guarantee chain integrity
|
||||
// - The persisted hashSyncCheckpoint in LevelDB blocks IBD from progressing
|
||||
|
||||
// Enforce rule that the coinbase starts with serialized block height
|
||||
CScript expect = CScript() << nHeight;
|
||||
|
||||
Reference in New Issue
Block a user