Skip to content

Commit 4ed2f5f

Browse files
NateIsernclaude
andcommitted
Re-enable proof-of-work validation and add chain checkpoints
pow.cpp: CheckProofOfWork() had the hash-vs-target comparison commented out, so it only ran the range check and accepted any hash for the claimed nBits. Re-enabled it. Verified safe by a full -reindex of the live chain (height ~11700) with the check enabled: every block, including the PoW range 1-10000 and all PoS blocks, validates with 0 errors, confirming the historical chain has valid proof-of-work. chainparams.cpp: the mainnet checkpoint map only contained genesis. Added checkpoints at blocks 1, 5000, 10000 (PoW->PoS boundary) and 11000 (all from the canonical chain) and updated CCheckpointData, for reorg / long-range-attack protection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dc49514 commit 4ed2f5f

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/chainparams.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,17 @@ static void convertSeed6(std::vector<CAddress>& vSeedsOut, const SeedSpec6* data
331331
// timestamp before)
332332
// + Contains no strange transactions
333333
static Checkpoints::MapCheckpoints mapCheckpoints =
334-
boost::assign::map_list_of(0, uint256("0x00000232cb134567cf85cd65748714df75d72fe4ce71cf77d3c3f8a9a1a576e6"));
334+
boost::assign::map_list_of
335+
(0, uint256("0x00000232cb134567cf85cd65748714df75d72fe4ce71cf77d3c3f8a9a1a576e6"))
336+
(1, uint256("0x00000c7be1164f34a243d233c94ec23e6fdc76813ac94b720a624d4ed52c9f0c"))
337+
(5000, uint256("0x000000001c5f95c383855c71fa5ee106efd0ce9b6c93198b55cd00f47c84126f"))
338+
(10000, uint256("0x00000000a840c1a7ca180f542fa26beed769bf0a91ba60c65b1d3d60911308c0")) // last PoW block (PoW->PoS boundary)
339+
(11000, uint256("0x9f6d23e28485c926d63e6a249f9983472f1e7bd467db56864a575891819ebd84"));
335340
static const Checkpoints::CCheckpointData mainCheckpointData = {
336341
&mapCheckpoints,
337-
1744156800, // April 9, 2026 00:00:00 UTC
338-
0,
339-
0
342+
1777017373, // block 10000 time (2026-04-24)
343+
10005, // total tx up to last checkpoint (approx)
344+
500 // estimated tx per day after checkpoint
340345
};
341346

342347
static Checkpoints::MapCheckpoints mapCheckpointsTestnet =

src/pow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
123123
return error("CheckProofOfWork() : nBits below minimum work");
124124

125125
// Check proof of work matches claimed amount
126-
///////////if (hash > bnTarget)
127-
//////////////return error("CheckProofOfWork() : hash doesn't match nBits");
126+
if (hash > bnTarget)
127+
return error("CheckProofOfWork() : hash doesn't match nBits");
128128

129129
return true;
130130
}

0 commit comments

Comments
 (0)