fix: race condition concurrent in and out from same peer (#7317)

This commit is contained in:
Matthias Seitz
2024-03-25 12:19:19 +01:00
committed by GitHub
parent 10854e5983
commit b58cca7f91
2 changed files with 63 additions and 3 deletions

View File

@ -40,8 +40,13 @@ pub enum ReputationChangeKind {
}
impl ReputationChangeKind {
/// Returns true if the reputation change is a reset.
/// Returns true if the reputation change is a [ReputationChangeKind::Reset].
pub fn is_reset(&self) -> bool {
matches!(self, Self::Reset)
}
/// Returns true if the reputation change is [ReputationChangeKind::Dropped].
pub fn is_dropped(&self) -> bool {
matches!(self, Self::Dropped)
}
}