finetune sticky mesh failure penalty parameter
This commit is contained in:
parent
f40b06e515
commit
48b7d01113
7
score.go
7
score.go
|
@ -383,8 +383,11 @@ func (ps *peerScore) Prune(p peer.ID, topic string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < ps.params.Topics[topic].MeshMessageDeliveriesThreshold {
|
// sticky mesh delivery rate failure penalty
|
||||||
tstats.meshFailurePenalty += 1
|
threshold := ps.params.Topics[topic].MeshMessageDeliveriesThreshold
|
||||||
|
if tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < threshold {
|
||||||
|
deficit := threshold - tstats.meshMessageDeliveries
|
||||||
|
tstats.meshFailurePenalty += deficit * deficit
|
||||||
}
|
}
|
||||||
|
|
||||||
tstats.inMesh = false
|
tstats.inMesh = false
|
||||||
|
|
Loading…
Reference in New Issue