consensus: Add assertions for Params::HalvingHeight parameters
- Height must be non-negative. - Halving index must be positive.
This commit is contained in:
parent
c3f0e181ef
commit
b47f686754
|
@ -47,6 +47,9 @@ namespace Consensus {
|
||||||
* first halving.
|
* first halving.
|
||||||
*/
|
*/
|
||||||
int Params::HalvingHeight(int nHeight, int halvingIndex) const {
|
int Params::HalvingHeight(int nHeight, int halvingIndex) const {
|
||||||
|
assert(nHeight >= 0);
|
||||||
|
assert(halvingIndex > 0);
|
||||||
|
|
||||||
// zip208
|
// zip208
|
||||||
// HalvingHeight(i) := max({ height ⦂ N | Halving(height) < i }) + 1
|
// HalvingHeight(i) := max({ height ⦂ N | Halving(height) < i }) + 1
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue