From aa5fd79a75f7480be94380bc3e617767e71573e6 Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Sat, 19 Aug 2023 14:51:43 +0530 Subject: [PATCH] fix: topicscore params can't be set for dynamically subscribed topic (#540) * fix: topicscore params can't be set for a topic subscribed after gossipsub is initialized * chore:address review comments --- score.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/score.go b/score.go index ec6c8213..7b317d7e 100644 --- a/score.go +++ b/score.go @@ -202,13 +202,9 @@ func (ps *peerScore) SetTopicScoreParams(topic string, p *TopicScoreParams) erro ps.Lock() defer ps.Unlock() - old, exist := ps.params.Topics[topic] + old := ps.params.Topics[topic] ps.params.Topics[topic] = p - if !exist { - return nil - } - // check to see if the counter Caps are being lowered; if that's the case we need to recap them recap := false if p.FirstMessageDeliveriesCap < old.FirstMessageDeliveriesCap {