pub(crate) async fn update_view<TYPES: NodeType>(
    new_view: TYPES::Time,
    event_stream: &Sender<Arc<HotShotEvent<TYPES>>>,
    timeout: u64,
    consensus: OuterConsensus<TYPES>,
    cur_view: &mut TYPES::Time,
    cur_view_time: &mut i64,
    timeout_task: &mut JoinHandle<()>,
    output_event_stream: &Sender<Event<TYPES>>,
    send_view_change_event: bool,
    is_old_view_leader: bool
) -> Result<()>
Expand description

Update the view if it actually changed, takes a mutable reference to the cur_view and the timeout_task which are updated during the operation of the function.

§Errors

Returns an anyhow::Error when the new view is not greater than the current view. TODO: Remove args when we merge dependency tasks.