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

Function GetLastStakeModifier

src/stake.cpp:135–148  ·  view source on GitHub ↗

Get the last stake modifier and its generation time from a given block

Source from the content-addressed store, hash-verified

133
134// Get the last stake modifier and its generation time from a given block
135static bool GetLastStakeModifier(const CBlockIndex* pindex, uint64_t& nStakeModifier, int64_t& nModifierTime) {
136 if (!pindex)
137 return error("%s: null pindex", __func__);
138
139 while (pindex && pindex->pprev && !pindex->GeneratedStakeModifier())
140 pindex = pindex->pprev;
141
142 if (!pindex->GeneratedStakeModifier())
143 return error("%s: no generation at genesis block", __func__);
144
145 nStakeModifier = pindex->nStakeModifier;
146 nModifierTime = pindex->GetBlockTime();
147 return true;
148}
149
150// Get selection interval (nSection in seconds)
151static int64_t GetSelectionInterval(int nSection) {

Callers 1

ComputeNextModifierMethod · 0.85

Calls 3

errorFunction · 0.85
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected