Get stake modifier checksum
| 846 | |
| 847 | // Get stake modifier checksum |
| 848 | unsigned int Stake::GetModifierChecksum(const CBlockIndex* pindex) { |
| 849 | assert(pindex->pprev || pindex->GetBlockHash() == Params().HashGenesisBlock()); |
| 850 | // Hash previous checksum with flags, hashProofOfStake and nStakeModifier |
| 851 | CDataStream ss(SER_GETHASH, 0); |
| 852 | if (pindex->pprev) |
| 853 | ss << pindex->pprev->nStakeModifierChecksum; |
| 854 | ss << pindex->nFlags << pindex->hashProofOfStake << pindex->nStakeModifier; |
| 855 | uint256 hashChecksum = Hash(ss.begin(), ss.end()); |
| 856 | hashChecksum >>= (256 - 32); |
| 857 | return hashChecksum.Get64(); |
| 858 | } |
| 859 | |
| 860 | // Check stake modifier hard checkpoints |
| 861 | bool Stake::CheckModifierCheckpoints(int nHeight, unsigned int nStakeModifierChecksum) { |
no test coverage detected