/// Increments the epoch, sets the new estimate and handles queued messages.
Increments the epoch, sets the new estimate and handles queued messages.
Increments the epoch sets the new estimate and handles queued messages .
fn update_epoch(&mut self, b: bool) -> Result<Step<N>> {
        self.sbv_broadcast.clear(&self.received_term);
        self.received_conf.clear();
        for (v, id) in &self.received_term {
            self.received_conf.insert(id.clone(), BoolSet::from(v));
        }
        self.conf_values = None;
        self.epoch += 1;
        self.coin_state = self.coin_state()?;
        debug!(
            "{}: epoch started, {} terminated",
            self,
            self.received_conf.len(),
        );
        self.estimated = Some(b);
        let sbvb_step = self.sbv_broadcast.send_bval(b)?;
        let mut step = self.handle_sbvb_step(sbvb_step)?;
        let epoch = self.epoch;
        let epoch_state = self.incoming_queue.remove(&epoch).into_iter().flatten();
        for (sender_id, received) in epoch_state {
            for m in received.messages() {
                step.extend(self.handle_message_content(&sender_id, m)?);
                if self.decision.is_some() || self.epoch > epoch {
                    return Ok(step);
                }
            }
        }
        Ok(step)
    }
fn update_epoch ( & mut self , b : bool ) -> Result < Step < N > > { self . sbv_broadcast . clear ( & self . received_term ) ; self . received_conf . clear ( ) ; for ( v , id ) in & self . received_term { self . received_conf . insert ( id . clone ( ) , BoolSet :: from ( v ) ) ; } self . conf_values = None ; self . epoch += 1 ; self . coin_state = self . coin_state ( ) ? ; debug ! ( " " self self received_conf len ( ) ) ; self . estimated = Some ( b ) ; let sbvb_step = self . sbv_broadcast . send_bval ( b ) ? ; let mut step = self . handle_sbvb_step ( sbvb_step ) ? ; let epoch = self . epoch ; let epoch_state = self . incoming_queue . remove ( & epoch ) . into_iter ( ) . flatten ( ) ; for ( sender_id , received ) in epoch_state { for m in received . messages ( ) { step . extend ( self . handle_message_content ( & sender_id , m ) ? ) ; if self . decision . is_some ( ) || self . epoch > epoch { return Ok ( step ) ; } } } Ok ( step ) }
Increments the epoch, sets the new estimate and handles queued messages.
Increments the epoch sets the new estimate and handles queued messages .
&mut self
b
bool