mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 22:03:07 +00:00
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
This commit is contained in:
parent
cef801641c
commit
aa5fd79a75
6
score.go
6
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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user