mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 15:23:08 +00:00
backoff grafting to peers that have pruned us
This commit is contained in:
parent
6b80c4078d
commit
85b455fa50
@ -373,6 +373,15 @@ func (gs *GossipSubRouter) connector() {
|
||||
}
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) addBackoff(p peer.ID, topic string) {
|
||||
backoff, ok := gs.backoff[topic]
|
||||
if !ok {
|
||||
backoff = make(map[peer.ID]time.Time)
|
||||
gs.backoff[topic] = backoff
|
||||
}
|
||||
backoff[p] = time.Now().Add(GossipSubPruneBackoff)
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) Publish(from peer.ID, msg *pb.Message) {
|
||||
gs.mcache.Put(msg)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user