mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 23:33:08 +00:00
protocol ID for gossipsub v1.1
This commit is contained in:
parent
abab666596
commit
6fc8050bac
@ -15,6 +15,7 @@ import (
|
||||
|
||||
const (
|
||||
GossipSubID = protocol.ID("/meshsub/1.0.0")
|
||||
GossipSubID_v11 = protocol.ID("/meshsub/1.1.0")
|
||||
)
|
||||
|
||||
var (
|
||||
@ -69,7 +70,7 @@ type GossipSubRouter struct {
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) Protocols() []protocol.ID {
|
||||
return []protocol.ID{GossipSubID, FloodSubID}
|
||||
return []protocol.ID{GossipSubID_v11, GossipSubID, FloodSubID}
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) Attach(p *PubSub) {
|
||||
@ -681,7 +682,7 @@ func (gs *GossipSubRouter) getPeers(topic string, count int, filter func(peer.ID
|
||||
|
||||
peers := make([]peer.ID, 0, len(tmap))
|
||||
for p := range tmap {
|
||||
if gs.peers[p] == GossipSubID && filter(p) {
|
||||
if (gs.peers[p] == GossipSubID || gs.peers[p] == GossipSubID_v11) && filter(p) {
|
||||
peers = append(peers, p)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user