From 7b4c1f9c15388fbd4ce198e13899cb78723d0f81 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Thu, 18 Jan 2024 18:04:39 +1100 Subject: [PATCH] Fix panics? --- protocols/gossipsub/src/behaviour.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 86f0eac43dd..80e487d72dc 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -1995,6 +1995,9 @@ where // remove unsubscribed peers from the mesh if it exists for (peer_id, topic_hash) in unsubscribed_peers { + self.fanout + .get_mut(&topic_hash) + .map(|peers| peers.remove(&peer_id)); self.remove_peer_from_mesh(&peer_id, &topic_hash, None, false, Churn::Unsub); }