mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 15:23:08 +00:00
delete mesh before sending prunes on leave
This commit is contained in:
parent
64d35994d1
commit
0e288dc741
@ -248,10 +248,11 @@ func (gs *GossipSubRouter) Leave(topic string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete(gs.mesh, topic)
|
||||||
|
|
||||||
for p := range gmap {
|
for p := range gmap {
|
||||||
gs.sendPrune(p, topic)
|
gs.sendPrune(p, topic)
|
||||||
}
|
}
|
||||||
delete(gs.mesh, topic)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gs *GossipSubRouter) sendGraft(p peer.ID, topic string) {
|
func (gs *GossipSubRouter) sendGraft(p peer.ID, topic string) {
|
||||||
@ -417,7 +418,7 @@ func (gs *GossipSubRouter) heartbeat() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// do we need more peers
|
// do we need more peers?
|
||||||
if len(peers) < GossipSubD {
|
if len(peers) < GossipSubD {
|
||||||
ineed := GossipSubD - len(peers)
|
ineed := GossipSubD - len(peers)
|
||||||
plst := gs.getPeers(topic, func(p peer.ID) bool {
|
plst := gs.getPeers(topic, func(p peer.ID) bool {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user