using System; namespace Novacoin { public static class HashCheckpoints { private static Tuple[] checkpoints = new Tuple[] { new Tuple(0, NetInfo.nHashGenesisBlock, 1360105017), new Tuple(200000, new uint256("0000000000029f8bbf66e6ea6f3e5db55009404aae0fe395a53dd33142b2bff2"), 1441127233), }; /// /// Last checkpoint height. /// public static uint TotalBlocksEstimate { get { return checkpoints[checkpoints.Length - 1].Item1; } } /// /// Last checkpoint timestamp. /// public static uint LastCheckpointTime { get { return checkpoints[checkpoints.Length - 1].Item3; } } /// /// Block hash verification. /// /// Block height. /// Block hash. /// public static bool Verify(uint nHeight, uint256 nBlockHash) { foreach (var checkpoint in checkpoints) { if (checkpoint.Item1 == nHeight) { return nBlockHash == checkpoint.Item2; } } return true; } } public static class ModifierCheckpoints { /// /// Stake modifier checkpoints /// private static Tuple[] modifierCheckpoints = new Tuple[] { new Tuple( 0, 0x0e00670bu ), new Tuple(200000, 0x01ec1503u ) }; /// /// Check stake modifier checkpoints. /// /// Block height. /// Modifier checksum value. /// Result public static bool Verify(uint nHeight, uint nStakeModifierChecksum) { foreach (var checkpoint in modifierCheckpoints) { if (checkpoint.Item1 == nHeight) { return checkpoint.Item2 == nStakeModifierChecksum; } } return true; } } }