summaryrefslogtreecommitdiffstats
path: root/src/api/peers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/peers.rs')
-rw-r--r--src/api/peers.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/api/peers.rs b/src/api/peers.rs
index 9af24c0..f0fd1d9 100644
--- a/src/api/peers.rs
+++ b/src/api/peers.rs
@@ -186,15 +186,14 @@ pub(crate) async fn delete_peer(
.map_err(|_| StatusCode::BAD_REQUEST)?;
// Unknown locally is fine: other nodes may still know the peer.
- if let Some(peer_state_mutex) = state.get_peer_state(&peer).await {
- if peer_state_mutex
+ if let Some(peer_state_mutex) = state.get_peer_state(&peer).await
+ && peer_state_mutex
.lock()
.await
.is_alive(&state.timing, Instant::now())
- && !force.allows("alive")
- {
- return Err(StatusCode::CONFLICT);
- }
+ && !force.allows("alive")
+ {
+ return Err(StatusCode::CONFLICT);
}
let record =