pub fn verify_voluntary_exit_for_gossip(
        &self,
        exit: SignedVoluntaryExit,
    ) -> Result<ObservationOutcome<SignedVoluntaryExit>, Error> {
        // NOTE: this could be more efficient if it avoided cloning the head state
        let wall_clock_state = self.wall_clock_state()?;
        Ok(self
            .observed_voluntary_exits
            .lock()
            .verify_and_observe(exit, &wall_clock_state, &self.spec)
            .map(|exit| {
                // this method is called for both API and gossip exits, so this covers all exit events
                if let Some(event_handler) = self.event_handler.as_ref() {
                    if event_handler.has_exit_subscribers() {
                        if let ObservationOutcome::New(exit) = exit.clone() {
                            event_handler.register(EventKind::VoluntaryExit(exit.into_inner()));
                        }
                    }
                }
                exit
            })?)
    }
/// Verify a voluntary exit before allowing it to propagate on the gossip network.
Verify a voluntary exit before allowing it to propagate on the gossip network.
Verify a voluntary exit before allowing it to propagate on the gossip network .
pub fn verify_voluntary_exit_for_gossip(
        &self,
        exit: SignedVoluntaryExit,
    ) -> Result<ObservationOutcome<SignedVoluntaryExit>, Error> {
        // NOTE: this could be more efficient if it avoided cloning the head state
        let wall_clock_state = self.wall_clock_state()?;
        Ok(self
            .observed_voluntary_exits
            .lock()
            .verify_and_observe(exit, &wall_clock_state, &self.spec)
            .map(|exit| {
                // this method is called for both API and gossip exits, so this covers all exit events
                if let Some(event_handler) = self.event_handler.as_ref() {
                    if event_handler.has_exit_subscribers() {
                        if let ObservationOutcome::New(exit) = exit.clone() {
                            event_handler.register(EventKind::VoluntaryExit(exit.into_inner()));
                        }
                    }
                }
                exit
            })?)
    }
pub fn verify_voluntary_exit_for_gossip ( & self , exit : SignedVoluntaryExit , ) -> Result < ObservationOutcome < SignedVoluntaryExit > , Error > { // NOTE: this could be more efficient if it avoided cloning the head state let wall_clock_state = self . wall_clock_state ( ) ? ; Ok ( self . observed_voluntary_exits . lock ( ) . verify_and_observe ( exit , & wall_clock_state , & self . spec ) . map ( | exit | { // this method is called for both API and gossip exits, so this covers all exit events if let Some ( event_handler ) = self . event_handler . as_ref ( ) { if event_handler . has_exit_subscribers ( ) { if let ObservationOutcome :: New ( exit ) = exit . clone ( ) { event_handler . register ( EventKind :: VoluntaryExit ( exit . into_inner ( ) ) ) ; } } } exit } ) ? ) }
Verify a voluntary exit before allowing it to propagate on the gossip network.
Verify a voluntary exit before allowing it to propagate on the gossip network .
&self
exit
SignedVoluntaryExit