diff --git a/waku/v2/protocol/filter/client.go b/waku/v2/protocol/filter/client.go index ca7977b5..9763b3de 100644 --- a/waku/v2/protocol/filter/client.go +++ b/waku/v2/protocol/filter/client.go @@ -436,9 +436,7 @@ func (wf *WakuFilterLightnode) UnsubscribeAll(ctx context.Context, opts ...Filte localWg.Wait() close(resultChan) for _, peerID := range peersUnsubscribed { - if len(wf.subscriptions.items[peerID].subscriptionsPerTopic) == 0 { - delete(wf.subscriptions.items, peerID) - } + delete(wf.subscriptions.items, peerID) } return resultChan, nil }