Skip to content

Commit

Permalink
Fix issue with pubsub topic removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Vlasov committed Sep 22, 2023
1 parent 035dc75 commit 7d77b67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion waku/v2/peerstore/waku_peer_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ func (ps *WakuPeerstoreImpl) RemovePubSubTopic(p peer.ID, topic string) error {
}

for i := range existingTopics {
existingTopics = append(existingTopics[:i], existingTopics[i+1:]...)
if existingTopics[i] == topic {
existingTopics = append(existingTopics[:i], existingTopics[i+1:]...)
break
}
}
err = ps.SetPubSubTopics(p, existingTopics)
if err != nil {
Expand Down

0 comments on commit 7d77b67

Please sign in to comment.