Revert "fix: topicscore params can't be set for dynamically subscribed topic (#540)" (#541)

This reverts commit aa5fd79a75f7480be94380bc3e617767e71573e6.
This commit is contained in:
vyzo 2023-08-26 18:26:28 +03:00 committed by GitHub
parent aa5fd79a75
commit 825d5e3c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,9 +202,13 @@ func (ps *peerScore) SetTopicScoreParams(topic string, p *TopicScoreParams) erro
ps.Lock()
defer ps.Unlock()
old := ps.params.Topics[topic]
old, exist := 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 {