add nil check for decayer

This commit is contained in:
Yusef Napora 2020-05-11 11:13:06 -04:00 committed by vyzo
parent 51369f756f
commit 2312cddaff

View File

@ -120,6 +120,9 @@ func (t *tagTracer) removeDeliveryTag(topic string) {
}
func (t *tagTracer) decayingDeliveryTag(topic string) (connmgr.DecayingTag, error) {
if t.decayer == nil {
return nil, fmt.Errorf("connection manager does not support decaying tags")
}
name := fmt.Sprintf("pubsub-deliveries:%s", topic)
// decrement tag value by GossipSubConnTagDecayAmount at each decay interval