respec decay to zero parameter in counter decay
This commit is contained in:
parent
b1aff8d752
commit
8c0deb877d
10
score.go
10
score.go
@ -239,9 +239,17 @@ func (ps *peerScore) refreshScores() {
|
|||||||
|
|
||||||
// decay counters
|
// decay counters
|
||||||
tstats.firstMessageDeliveries *= topicParams.FirstMessageDeliveriesDecay
|
tstats.firstMessageDeliveries *= topicParams.FirstMessageDeliveriesDecay
|
||||||
|
if tstats.firstMessageDeliveries < ps.params.DecayToZero {
|
||||||
|
tstats.firstMessageDeliveries = 0
|
||||||
|
}
|
||||||
tstats.meshMessageDeliveries *= topicParams.MeshMessageDeliveriesDecay
|
tstats.meshMessageDeliveries *= topicParams.MeshMessageDeliveriesDecay
|
||||||
|
if tstats.meshMessageDeliveries < ps.params.DecayToZero {
|
||||||
|
tstats.meshMessageDeliveries = 0
|
||||||
|
}
|
||||||
tstats.invalidMessageDeliveries *= topicParams.InvalidMessageDeliveriesDecay
|
tstats.invalidMessageDeliveries *= topicParams.InvalidMessageDeliveriesDecay
|
||||||
|
if tstats.invalidMessageDeliveries < ps.params.DecayToZero {
|
||||||
|
tstats.invalidMessageDeliveries = 0
|
||||||
|
}
|
||||||
// update mesh time and activate mesh message delivery parameter if need be
|
// update mesh time and activate mesh message delivery parameter if need be
|
||||||
if tstats.inMesh {
|
if tstats.inMesh {
|
||||||
tstats.meshTime = now.Sub(tstats.graftTime)
|
tstats.meshTime = now.Sub(tstats.graftTime)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user