/// The number of expected counters determines
/// when we have an agreed value. Must be uneven.
/// The vec can be empty or contain any number already.
The number of expected counters determines
when we have an agreed value. Must be uneven.
The vec can be empty or contain any number already.
The number of expected counters determines when we have an agreed value . Must be uneven . The vec can be empty or contain any number already .
pub fn new(expected_counters: usize, counters: Vec<RewardCounter>) -> Result<Self> {
        if expected_counters % 2 == 0 || 3 > expected_counters {
            return Err(Error::InvalidOperation);
        }
        let quorum = (expected_counters / 3) * 2;
        Ok(Self { quorum, counters })
    }
pub fn new ( expected_counters : usize , counters : Vec < RewardCounter > ) -> Result < Self > { if expected_counters % 2 == 0 || 3 > expected_counters { return Err ( Error :: InvalidOperation ) ; } let quorum = ( expected_counters / 3 ) * 2 ; Ok ( Self { quorum , counters } ) }
The number of expected counters determines
when we have an agreed value.
The number of expected counters determines when we have an agreed value .
expected_counters
usize
counters
Vec<RewardCounter>