CBlock::AcceptBlock method

From Peercoin Wiki
Jump to: navigation, search

Source

https://github.com/ppcoin/ppcoin/blob/v0.4.0ppc/src/main.cpp#L1915

(...)
// Check proof-of-work or proof-of-stake
if (nBits != GetNextTargetRequired(pindexPrev, IsProofOfStake()))
    return DoS(100, error("AcceptBlock() : incorrect proof-of-work/proof-of-stake"));
(...)
// ppcoin: check that the block satisfies synchronized checkpoint
if (!Checkpoints::CheckSync(hash, pindexPrev))
    return error("AcceptBlock() : rejected by synchronized checkpoint");
(...)
// ppcoin: check pending sync-checkpoint
Checkpoints::AcceptPendingSyncCheckpoint();
(...)