Skip to content

Commit

Permalink
netmap: Fix check condition of EigenTrust alpha parameter
Browse files Browse the repository at this point in the history
Previous condition in `NetworkInfo.ReadFromV2` method was wrong and
unreachable.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Sep 20, 2024
1 parent cb119ab commit 167ff33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netmap/network_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool)

num, err = decodeConfigValueUint64(prm.GetValue())
if err == nil {
if alpha := math.Float64frombits(num); alpha < 0 && alpha > 1 {
if alpha := math.Float64frombits(num); alpha < 0 || alpha > 1 { // FIXME
err = fmt.Errorf("EigenTrust alpha value %0.2f is out of range [0, 1]", alpha)
}
}
Expand Down

0 comments on commit 167ff33

Please sign in to comment.