Function ValidatorSet.countActive
Gets the number of active validators at a given block height.
This function finds validators that should be active at a given height, provided they do not get slashed. Active validators are those that can sign a block.
This can be used to look up arbitrary height in the future, as long as
the height is not over ValidatorCycle
distance from the known state
of the ValidatorSet (in such case, 0 will always be returned).
Parameters
Name | Description |
---|---|
height | height at which to count the validators |
Returns
Returns the number of active validators when the block height is
block_height
, or 0 in case of error.