consensus: Add assertions for Params::HalvingHeight parameters

- Height must be non-negative.
- Halving index must be positive.
This commit is contained in:
Jack Grigg 2020-08-20 13:14:44 +01:00
parent c3f0e181ef
commit b47f686754
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ namespace Consensus {
* first halving.
*/
int Params::HalvingHeight(int nHeight, int halvingIndex) const {
assert(nHeight >= 0);
assert(halvingIndex > 0);
// zip208
// HalvingHeight(i) := max({ height ⦂ N | Halving(height) < i }) + 1
//