Skip to content

Commit

Permalink
Fix deleting pubsub topics; only allow adding unique topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Vlasov committed Sep 22, 2023
1 parent 9f4754d commit a3d1203
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions waku/v2/peerstore/waku_peer_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func (ps *WakuPeerstoreImpl) AddPubSubTopic(p peer.ID, topic string) error {
if err != nil {
return err
}
for _, t := range existingTopics {
if t == topic {
return nil
}
}
existingTopics = append(existingTopics, topic)
return ps.peerStore.Put(p, peerPubSubTopics, existingTopics)
}
Expand Down

0 comments on commit a3d1203

Please sign in to comment.