pub fn update_queue(&mut self, added_roots: &[&[u8]], abandoned_roots: &[(u64, &[u8])]) {
        // add the roots that have been abandoned.
        for (height, state_root_hash) in abandoned_roots {
            self.add_to_queue(*height, state_root_hash);
        }
        // Remove any state root hashes from the pruning queue that we may have switched
        // back too from an alternate chain
        let mut new_queue = BinaryHeap::with_capacity(0);
        ::std::mem::swap(&mut self.state_root_prune_queue, &mut new_queue);
        self.state_root_prune_queue = new_queue
            .into_iter()
            .filter(|candidate| {
                if !added_roots.contains(&candidate.1.as_slice()) {
                    true
                } else {
                    debug!("Removing {} from pruning queue", hex::encode(&candidate.1));
                    false
                }
            })
            .collect();
    }
/// Updates the pruning queue.  Abandoned roots will be added to the queue.
/// Added roots will be removed from the queue.  This ensures that the state
/// roots won't be removed, regardless of the chain state.
Updates the pruning queue.  Abandoned roots will be added to the queue.
Added roots will be removed from the queue.  This ensures that the state
roots won't be removed, regardless of the chain state.
Updates the pruning queue . Abandoned roots will be added to the queue . Added roots will be removed from the queue . This ensures that the state roots won ' t be removed regardless of the chain state .
pub fn update_queue(&mut self, added_roots: &[&[u8]], abandoned_roots: &[(u64, &[u8])]) {
        // add the roots that have been abandoned.
        for (height, state_root_hash) in abandoned_roots {
            self.add_to_queue(*height, state_root_hash);
        }
        // Remove any state root hashes from the pruning queue that we may have switched
        // back too from an alternate chain
        let mut new_queue = BinaryHeap::with_capacity(0);
        ::std::mem::swap(&mut self.state_root_prune_queue, &mut new_queue);
        self.state_root_prune_queue = new_queue
            .into_iter()
            .filter(|candidate| {
                if !added_roots.contains(&candidate.1.as_slice()) {
                    true
                } else {
                    debug!("Removing {} from pruning queue", hex::encode(&candidate.1));
                    false
                }
            })
            .collect();
    }
pub fn update_queue ( & mut self , added_roots : & [ & [ u8 ] ] , abandoned_roots : & [ ( u64 , & [ u8 ] ) ] ) { // add the roots that have been abandoned. for ( height , state_root_hash ) in abandoned_roots { self . add_to_queue ( * height , state_root_hash ) ; } // Remove any state root hashes from the pruning queue that we may have switched // back too from an alternate chain let mut new_queue = BinaryHeap :: with_capacity ( 0 ) ; :: std :: mem :: swap ( & mut self . state_root_prune_queue , & mut new_queue ) ; self . state_root_prune_queue = new_queue . into_iter ( ) . filter ( | candidate | { if ! added_roots . contains ( & candidate . 1 . as_slice ( ) ) { true } else { debug ! ( " " hex encode ( candidate 1 ) ) ; false } } ) . collect ( ) ; }
Updates the pruning queue.
Updates the pruning queue .
&mut self
added_roots
&[&[u8]]
abandoned_roots
&[(u64, &[u8])]
&mut self
added_roots
&[&[u8]]
abandoned_roots
&[(u64, &[u8])]