MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetModifierChecksum

Method GetModifierChecksum

src/stake.cpp:848–858  ·  view source on GitHub ↗

Get stake modifier checksum

Source from the content-addressed store, hash-verified

846
847// Get stake modifier checksum
848unsigned 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
861bool Stake::CheckModifierCheckpoints(int nHeight, unsigned int nStakeModifierChecksum) {

Callers 1

AddToBlockIndexFunction · 0.80

Calls 6

Get64Method · 0.80
ParamsClass · 0.70
HashFunction · 0.70
GetBlockHashMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected