fn purge(&mut self, height: Height) {
        self.current_start_height = height;
        // TODO: use drain_filter once it's stable.
        let unvalidated_keys: Vec<_> = self
            .unvalidated
            .iter()
            .filter(|(_, artifact)| artifact.message.content.dkg_id.start_block_height < height)
            .map(|(hash, _)| hash)
            .cloned()
            .collect();
        for hash in unvalidated_keys {
            self.unvalidated.remove(&hash);
        }

        let validated_keys: Vec<_> = self
            .validated
            .iter()
            .filter(|(_, artifact)| artifact.msg.content.dkg_id.start_block_height < height)
            .map(|(hash, _)| hash)
            .cloned()
            .collect();
        for hash in validated_keys {
            self.validated.remove(&hash);
        }
    }
/// Deletes all validated and unvalidated messages, which do not correspond
/// to the current DKG interval.
Deletes all validated and unvalidated messages, which do not correspond
to the current DKG interval.
Deletes all validated and unvalidated messages which do not correspond to the current DKG interval .
fn purge(&mut self, height: Height) {
        self.current_start_height = height;
        // TODO: use drain_filter once it's stable.
        let unvalidated_keys: Vec<_> = self
            .unvalidated
            .iter()
            .filter(|(_, artifact)| artifact.message.content.dkg_id.start_block_height < height)
            .map(|(hash, _)| hash)
            .cloned()
            .collect();
        for hash in unvalidated_keys {
            self.unvalidated.remove(&hash);
        }
        let validated_keys: Vec<_> = self
            .validated
            .iter()
            .filter(|(_, artifact)| artifact.msg.content.dkg_id.start_block_height < height)
            .map(|(hash, _)| hash)
            .cloned()
            .collect();
        for hash in validated_keys {
            self.validated.remove(&hash);
        }
    }
fn purge ( & mut self , height : Height ) { self . current_start_height = height ; // TODO: use drain_filter once it's stable. let unvalidated_keys : Vec < _ > = self . unvalidated . iter ( ) . filter ( | ( _ , artifact ) | artifact . message . content . dkg_id . start_block_height < height ) . map ( | ( hash , _ ) | hash ) . cloned ( ) . collect ( ) ; for hash in unvalidated_keys { self . unvalidated . remove ( & hash ) ; } let validated_keys : Vec < _ > = self . validated . iter ( ) . filter ( | ( _ , artifact ) | artifact . msg . content . dkg_id . start_block_height < height ) . map ( | ( hash , _ ) | hash ) . cloned ( ) . collect ( ) ; for hash in validated_keys { self . validated . remove ( & hash ) ; } }
Deletes all validated and unvalidated messages, which do not correspond
to the current DKG interval.
Deletes all validated and unvalidated messages which do not correspond to the current DKG interval .
&mut self
height
Height
&mut self
height
Height