Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/activation.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
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 pindexPrev->GetMedianTimePast() >= | return (!gArgs.IsArgSet("-phononactivationtime") && | ||||
gArgs.GetArg("-phononactivationtime", params.phononActivationTime); | gArgs.GetBoolArg("-activatenextupgrade", false)) || | ||||
jasonbcox: I think making this checking logic more complex as well as complicating the associated test… | |||||
FabienAuthorUnsubmitted Done Inline ActionsThere are a few problems with this approach:
Fabien: There are a few problems with this approach:
- Setting `-activatenextupgrade` implies setting… | |||||
(pindexPrev->GetMedianTimePast() >= | |||||
gArgs.GetArg("-phononactivationtime", params.phononActivationTime)); | |||||
} | } |
I think making this checking logic more complex as well as complicating the associated test isn't the right way to do this. Setting -activatenextupgrade should be a proxy for setting -phononactivationtime (or whatever the next upgrade activation argument is) to current time - 1 second. This way, the -activatenextupgrade check is out of the code path for the actual upgrade (which IMO should be as simple as possible).