mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 05:43:06 +00:00
check if already in the mesh in handleGraft to support concurrent grafting
This commit is contained in:
parent
eef4d41e0e
commit
39fc35f7cb
@ -537,6 +537,12 @@ func (gs *GossipSubRouter) handleGraft(p peer.ID, ctl *pb.ControlMessage) []*pb.
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if it is already in the mesh; if so do nothing (we might have concurrent grafting)
|
||||||
|
_, inMesh := peers[p]
|
||||||
|
if inMesh {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// we don't GRAFT to/from direct peers; complain loudly if this happens
|
// we don't GRAFT to/from direct peers; complain loudly if this happens
|
||||||
_, direct := gs.direct[p]
|
_, direct := gs.direct[p]
|
||||||
if direct {
|
if direct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user