mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Add message expiry to the Tendermint gossip
This commit is contained in:
@@ -55,4 +55,11 @@ impl<T: TendermintValidator> Validator<T::Block> for TendermintGossip<T> {
|
||||
|
||||
ValidationResult::ProcessAndKeep(Self::topic(msg.number().0))
|
||||
}
|
||||
|
||||
fn message_expired<'a>(
|
||||
&'a self,
|
||||
) -> Box<dyn FnMut(<T::Block as Block>::Hash, &[u8]) -> bool + 'a> {
|
||||
let number = self.number.clone();
|
||||
Box::new(move |topic, _| topic != Self::topic(*number.read().unwrap()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user