Divide by 0 error fix for Node with 0 validators

This commit is contained in:
Sudipta Basak 2024-06-25 10:08:08 +00:00
parent 588ead24f9
commit f5f2131a45
No known key found for this signature in database

View File

@ -83,8 +83,8 @@ class Observer:
sampleProgress = arrived / expected
nodeProgress = ready / (len(validators)-1)
validatorCnt = sum([v.vpn for v in validators[1:]])
validatorAllProgress = validatedall / validatorCnt
validatorProgress = validated / validatorCnt
validatorAllProgress = (validatedall / validatorCnt) if validatorCnt != 0 else 1
validatorProgress = (validated / validatorCnt) if validatorCnt != 0 else 1
return missingSamples, sampleProgress, nodeProgress, validatorAllProgress, validatorProgress