Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/activation.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | bool IsMagneticAnomalyEnabled(const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindexPrev) { | const CBlockIndex *pindexPrev) { | ||||
if (pindexPrev == nullptr) { | if (pindexPrev == nullptr) { | ||||
return false; | return false; | ||||
} | } | ||||
return IsMagneticAnomalyEnabled(params, pindexPrev->nHeight); | return IsMagneticAnomalyEnabled(params, pindexPrev->nHeight); | ||||
} | } | ||||
static bool IsGravitonEnabled(const Consensus::Params ¶ms, | |||||
int32_t nHeight) { | |||||
return nHeight >= params.gravitonHeight; | |||||
} | |||||
bool IsGravitonEnabled(const Consensus::Params ¶ms, | bool IsGravitonEnabled(const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindexPrev) { | const CBlockIndex *pindexPrev) { | ||||
if (pindexPrev == nullptr) { | if (pindexPrev == nullptr) { | ||||
return false; | return false; | ||||
} | } | ||||
return pindexPrev->GetMedianTimePast() >= | return IsGravitonEnabled(params, pindexPrev->nHeight); | ||||
gArgs.GetArg("-gravitonactivationtime", | |||||
params.gravitonActivationTime); | |||||
} | } | ||||
bool IsPhononEnabled(const Consensus::Params ¶ms, | bool IsPhononEnabled(const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindexPrev) { | const CBlockIndex *pindexPrev) { | ||||
if (pindexPrev == nullptr) { | if (pindexPrev == nullptr) { | ||||
return false; | return false; | ||||
} | } | ||||
return (!gArgs.IsArgSet("-phononactivationtime") && | return (!gArgs.IsArgSet("-phononactivationtime") && | ||||
gArgs.GetBoolArg("-activatenextupgrade", false)) || | gArgs.GetBoolArg("-activatenextupgrade", false)) || | ||||
(pindexPrev->GetMedianTimePast() >= | (pindexPrev->GetMedianTimePast() >= | ||||
gArgs.GetArg("-phononactivationtime", params.phononActivationTime)); | gArgs.GetArg("-phononactivationtime", params.phononActivationTime)); | ||||
} | } |