Function Ledger.validatorCount

Get the count of active validators at a given height.

ulong validatorCount (
  in const(Height) height
) nothrow scope @safe;

This function is more efficient than checking the length of the array returned by getValidators as it avoids any intermediate allocation. An 'active' validator is one that hasn't been slashed, and may sign a block. A validator that enrolls, reveal all its pre-images but never sign a block will still be counted as 'active'.

Parameters

NameDescription
height Height at which to query the validator set. Accurate results are only guaranteed for height <= this.height() + 1.

Returns

Number of active validators at height.