Skip to content

Commit

Permalink
fix: topicscore params can't be set for dynamically subscribed topic (l…
Browse files Browse the repository at this point in the history
…ibp2p#540)

* fix: topicscore params can't be set for a topic subscribed after gossipsub is initialized

* chore:address review comments
  • Loading branch information
chaitanyaprem committed Aug 19, 2023
1 parent cef8016 commit aa5fd79
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions score.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit aa5fd79

Please sign in to comment.