diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index e843194..5f74879 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -1251,7 +1251,7 @@ method subscribe*(g: GossipSub, g.rebalanceMesh(topic) -method unsubscribeAll*(g: GossipSub, topic: string) = +proc unsubscribe*(g: GossipSub, topic: string) = var msg = RPCMsg.withSubs(@[topic], subscribe = false) gpeers = g.gossipsub.getOrDefault(topic) @@ -1281,6 +1281,8 @@ method unsubscribeAll*(g: GossipSub, topic: string) = else: g.broadcast(toSeq(gpeers), msg) +method unsubscribeAll*(g: GossipSub, topic: string) = + g.unsubscribe(topic) # finally let's remove from g.topics, do that by calling PubSub procCall PubSub(g).unsubscribeAll(topic) @@ -1292,7 +1294,7 @@ method unsubscribe*(g: GossipSub, # delete from mesh only if no handlers are left # (handlers are removed in pubsub unsubscribe above) if topic notin g.topics: - g.unsubscribeAll(topic) + g.unsubscribe(topic) method publish*(g: GossipSub, topic: string,