Extract a helper method for finding the next epoch

This commit is contained in:
Jack Grigg
2018-09-12 10:07:44 +01:00
parent ebf4c0671e
commit 07d3f947ec
3 changed files with 49 additions and 6 deletions

View File

@@ -79,6 +79,12 @@ bool IsActivationHeightForAnyUpgrade(
int nHeight,
const Consensus::Params& params);
/**
* Returns the index of the next upgrade after the given block height, or
* boost::none if there are no more known upgrades.
*/
boost::optional<int> NextEpoch(int nHeight, const Consensus::Params& params);
/**
* Returns the activation height for the next upgrade after the given block height,
* or boost::none if there are no more known upgrades.