This commit is contained in:
Dmitriy Ryajov 2021-06-01 18:06:08 -06:00 committed by GitHub
parent 34787728a3
commit 1b94c3feda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -288,7 +288,8 @@ proc updateScores*(g: GossipSub) = # avoid async
trace "updated scores", peers = g.peers.len
proc punishInvalidMessage*(g: GossipSub, peer: PubSubPeer, topics: seq[string]) =
for t in topics:
for tt in topics:
let t = tt
if t notin g.topics:
continue
@ -301,7 +302,8 @@ proc addCapped*[T](stat: var T, diff, cap: T) =
proc rewardDelivered*(
g: GossipSub, peer: PubSubPeer, topics: openArray[string], first: bool) =
for t in topics:
for tt in topics:
let t = tt
if t notin g.topics:
continue
let topicParams = g.topicParams.mgetOrPut(t, TopicParams.init())