fix:during unsubscribeAll, remove peer without any checks

This commit is contained in:
Prem Chaitanya Prathi 2023-08-07 15:01:44 +05:30
parent baeaa1dd55
commit af7471d158
No known key found for this signature in database
1 changed files with 1 additions and 3 deletions

View File

@ -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
}