// Returns the states checkpointed since the last time process_changes was
// called.
Returns the states checkpointed since the last time process_changes was
called.
Returns the states checkpointed since the last time process_changes was called .
fn process_changes(
        &self,
        _time_source: &dyn TimeSource,
        _artifacts: Vec<UnvalidatedArtifact<StateSyncMessage>>,
    ) -> (Vec<AdvertSendRequest<StateSyncArtifact>>, ProcessingResult) {
        let filter = StateSyncFilter {
            height: self.states.read().last_advertised,
        };
        let artifacts = self.get_all_validated_by_filter(&filter);
        let artifacts: Vec<AdvertSendRequest<StateSyncArtifact>> = artifacts
            .iter()
            .cloned()
            .map(|advert| AdvertSendRequest {
                advert,
                advert_class: AdvertClass::Critical,
            })
            .collect();
        if let Some(artifact) = artifacts.last() {
            self.states.write().last_advertised = artifact.advert.attribute.height;
        }
        (artifacts, ProcessingResult::StateUnchanged)
    }
fn process_changes ( & self , _time_source : & dyn TimeSource , _artifacts : Vec < UnvalidatedArtifact < StateSyncMessage > > , ) -> ( Vec < AdvertSendRequest < StateSyncArtifact > > , ProcessingResult ) { let filter = StateSyncFilter { height : self . states . read ( ) . last_advertised , } ; let artifacts = self . get_all_validated_by_filter ( & filter ) ; let artifacts : Vec < AdvertSendRequest < StateSyncArtifact > > = artifacts . iter ( ) . cloned ( ) . map ( | advert | AdvertSendRequest { advert , advert_class : AdvertClass :: Critical , } ) . collect ( ) ; if let Some ( artifact ) = artifacts . last ( ) { self . states . write ( ) . last_advertised = artifact . advert . attribute . height ; } ( artifacts , ProcessingResult :: StateUnchanged ) }
Returns the states checkpointed since the last time process_changes was
called.
Returns the states checkpointed since the last time process_changes was called .
&self
_time_source
&dyn TimeSource
_artifacts
Vec<UnvalidatedArtifact<StateSyncMessage>>