Skip to content

Commit

Permalink
Remove as stale instead of erroring (#5007)
Browse files Browse the repository at this point in the history
  • Loading branch information
neacsu authored Oct 22, 2024
1 parent 9a45de5 commit 2d78f69
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions service-providers/authenticator/src/mixnet_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,17 @@ impl<S: Storage + Clone + 'static> MixnetListener<S> {
reg.gateway_data.private_ip
)))?;

let timestamp = ip.ok_or(AuthenticatorError::InternalDataCorruption(
"timestamp should be set".to_string(),
))?;
let duration = SystemTime::now().duration_since(timestamp).map_err(|_| {
let Some(timestamp) = ip else {
registred_and_free
.registration_in_progres
.remove(&reg.gateway_data.pub_key());
log::debug!(
"Removed stale registration of {}",
reg.gateway_data.pub_key()
);
continue;
};
let duration = SystemTime::now().duration_since(*timestamp).map_err(|_| {
AuthenticatorError::InternalDataCorruption(
"set timestamp shouldn't have been set in the future".to_string(),
)
Expand Down

0 comments on commit 2d78f69

Please sign in to comment.