Check stake modifier hard checkpoints
| 859 | |
| 860 | // Check stake modifier hard checkpoints |
| 861 | bool Stake::CheckModifierCheckpoints(int nHeight, unsigned int nStakeModifierChecksum) { |
| 862 | if (!IsTestNet()) return true; // Testnet has no checkpoints |
| 863 | |
| 864 | // Hard checkpoints of stake modifiers to ensure they are deterministic |
| 865 | static std::map<int, unsigned int> mapStakeModifierCheckpoints = boost::assign::map_list_of(0, 0xfd11f4e7u) |
| 866 | (1, 0x6bf176c7u) (10, 0xc533c5deu) (20, 0x722262a0u) (30, 0xdd0abd8au) (90, 0x0308db9cu) |
| 867 | (409, 0xa9e2be4au) (410, 0xc23d7dd1u) (1141, 0xe81ae310u) (1144, 0x6543da9du) (1154, 0x8d110f11u) |
| 868 | (2914, 0x4fc1bc8du) (2916, 0x838297bau) (2915, 0xf5c77be4u) (2991, 0x6873f1efu) (3000, 0xffc1801fu) |
| 869 | (3001, 0x4b76d1f9u) (3035, 0x5cd70041u) (3036, 0xc689f15au) (3040, 0x19e1fa9eu) (3046, 0xa53146c5u) |
| 870 | (3277, 0x992f3f6cu) (3278, 0x9db692d0u) (3288, 0x96fb270du) (3438, 0x2ea722b2u) (4003, 0xdf3987e9u) |
| 871 | (4012, 0x205080bcu) (4025, 0x19ebed80u) (4034, 0xd02dd7ecu) (4045, 0x4b753d54u) (4053, 0xe7265e2au) |
| 872 | (10004, 0x09b6b5e1u) (10016, 0x05be852du) (10023, 0x4dcc3f34u) (10036, 0x5c16bf7du) (10049, 0x3b542151u) |
| 873 | (19998, 0x52052da4u) (20338, 0x3174b362u) (20547, 0x5e94b5acu) (20555, 0x5d77d04au) (33742, 0x998c4a1bu) |
| 874 | (127733, 0x92aa36acu) (129248, 0x680b9ce2u) (130092, 0x202cab1fu) (130775, 0x09694eb8u) (130780, 0x02e5287fu) |
| 875 | (131465, 0x515203adu) (132137, 0xb14a3a42u) (132136, 0x81b5ef99u) (135072, 0xea90da6au) (139756, 0xb3d7fb47u) |
| 876 | (141584, 0xeee6259fu) (143866, 0xcd2ed8ddu) (151181, 0xc2377de7u) (151659, 0x2bb1e741u) (151660, 0xade7324du) |
| 877 | ; |
| 878 | if (mapStakeModifierCheckpoints.count(nHeight)) { |
| 879 | return nStakeModifierChecksum == mapStakeModifierCheckpoints[nHeight]; |
| 880 | } |
| 881 | return true; |
| 882 | } |
| 883 | |
| 884 | unsigned int Stake::GetStakeAge(unsigned int nTime) const { |
| 885 | auto const nStakingMinAge=Params().StakingMinAge(); |
no test coverage detected