fn purge_artifacts(
        &self,
        ecdsa_pool: &dyn EcdsaPool,
        block_reader: &dyn EcdsaBlockReader,
    ) -> EcdsaChangeSet {
        let mut in_progress = BTreeSet::new();
        for transcript_params in block_reader.requested_transcripts() {
            in_progress.insert(transcript_params.transcript_id());
        }

        let mut ret = Vec::new();
        let current_height = block_reader.height();

        // Unvalidated dealings.
        let mut action = ecdsa_pool
            .unvalidated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                self.should_purge(signed_dealing.get(), current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveUnvalidated(id))
            .collect();
        ret.append(&mut action);

        // Validated dealings.
        let mut action = ecdsa_pool
            .validated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                self.should_purge(signed_dealing.get(), current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveValidated(id))
            .collect();
        ret.append(&mut action);

        // Unvalidated dealing support.
        let mut action = ecdsa_pool
            .unvalidated()
            .dealing_support()
            .filter(|(_, support)| {
                self.should_purge(&support.content, current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveUnvalidated(id))
            .collect();
        ret.append(&mut action);

        // Validated dealing support.
        let mut action = ecdsa_pool
            .validated()
            .dealing_support()
            .filter(|(_, support)| {
                self.should_purge(&support.content, current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveValidated(id))
            .collect();
        ret.append(&mut action);

        ret
    }
/// Purges the entries no longer needed from the artifact pool
Purges the entries no longer needed from the artifact pool
Purges the entries no longer needed from the artifact pool
fn purge_artifacts(
        &self,
        ecdsa_pool: &dyn EcdsaPool,
        block_reader: &dyn EcdsaBlockReader,
    ) -> EcdsaChangeSet {
        let mut in_progress = BTreeSet::new();
        for transcript_params in block_reader.requested_transcripts() {
            in_progress.insert(transcript_params.transcript_id());
        }
        let mut ret = Vec::new();
        let current_height = block_reader.height();
        // Unvalidated dealings.
        let mut action = ecdsa_pool
            .unvalidated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                self.should_purge(signed_dealing.get(), current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveUnvalidated(id))
            .collect();
        ret.append(&mut action);
        // Validated dealings.
        let mut action = ecdsa_pool
            .validated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                self.should_purge(signed_dealing.get(), current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveValidated(id))
            .collect();
        ret.append(&mut action);
        // Unvalidated dealing support.
        let mut action = ecdsa_pool
            .unvalidated()
            .dealing_support()
            .filter(|(_, support)| {
                self.should_purge(&support.content, current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveUnvalidated(id))
            .collect();
        ret.append(&mut action);
        // Validated dealing support.
        let mut action = ecdsa_pool
            .validated()
            .dealing_support()
            .filter(|(_, support)| {
                self.should_purge(&support.content, current_height, &in_progress)
            })
            .map(|(id, _)| EcdsaChangeAction::RemoveValidated(id))
            .collect();
        ret.append(&mut action);
        ret
    }
fn purge_artifacts ( & self , ecdsa_pool : & dyn EcdsaPool , block_reader : & dyn EcdsaBlockReader , ) -> EcdsaChangeSet { let mut in_progress = BTreeSet :: new ( ) ; for transcript_params in block_reader . requested_transcripts ( ) { in_progress . insert ( transcript_params . transcript_id ( ) ) ; } let mut ret = Vec :: new ( ) ; let current_height = block_reader . height ( ) ; // Unvalidated dealings. let mut action = ecdsa_pool . unvalidated ( ) . signed_dealings ( ) . filter ( | ( _ , signed_dealing ) | { self . should_purge ( signed_dealing . get ( ) , current_height , & in_progress ) } ) . map ( | ( id , _ ) | EcdsaChangeAction :: RemoveUnvalidated ( id ) ) . collect ( ) ; ret . append ( & mut action ) ; // Validated dealings. let mut action = ecdsa_pool . validated ( ) . signed_dealings ( ) . filter ( | ( _ , signed_dealing ) | { self . should_purge ( signed_dealing . get ( ) , current_height , & in_progress ) } ) . map ( | ( id , _ ) | EcdsaChangeAction :: RemoveValidated ( id ) ) . collect ( ) ; ret . append ( & mut action ) ; // Unvalidated dealing support. let mut action = ecdsa_pool . unvalidated ( ) . dealing_support ( ) . filter ( | ( _ , support ) | { self . should_purge ( & support . content , current_height , & in_progress ) } ) . map ( | ( id , _ ) | EcdsaChangeAction :: RemoveUnvalidated ( id ) ) . collect ( ) ; ret . append ( & mut action ) ; // Validated dealing support. let mut action = ecdsa_pool . validated ( ) . dealing_support ( ) . filter ( | ( _ , support ) | { self . should_purge ( & support . content , current_height , & in_progress ) } ) . map ( | ( id , _ ) | EcdsaChangeAction :: RemoveValidated ( id ) ) . collect ( ) ; ret . append ( & mut action ) ; ret }
Purges the entries no longer needed from the artifact pool
Purges the entries no longer needed from the artifact pool
&self
ecdsa_pool
&dyn EcdsaPool
block_reader
&dyn EcdsaBlockReader
&self
ecdsa_pool
&dyn EcdsaPool
block_reader
&dyn EcdsaBlockReader