From 9fbc6f5efe33c60678559a53850f60b6f98e02dd Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 13 May 2021 20:19:06 +0300 Subject: [PATCH] [#527] reputation: Fix EigenTrust algorithm Signed-off-by: Pavel Karpy --- cmd/neofs-node/reputation/local/storage.go | 1 + pkg/services/reputation/local/storage/calls.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-node/reputation/local/storage.go b/cmd/neofs-node/reputation/local/storage.go index 70797093..f3a3a39d 100644 --- a/cmd/neofs-node/reputation/local/storage.go +++ b/cmd/neofs-node/reputation/local/storage.go @@ -62,6 +62,7 @@ func (it *TrustIterator) Iterate(h reputation.TrustHandler) error { for i := range nm.Nodes { if bytes.Equal(nm.Nodes[i].PublicKey(), it.storage.LocalKey) { localIndex = i + break } } diff --git a/pkg/services/reputation/local/storage/calls.go b/pkg/services/reputation/local/storage/calls.go index 04605378..d68c6e0b 100644 --- a/pkg/services/reputation/local/storage/calls.go +++ b/pkg/services/reputation/local/storage/calls.go @@ -158,7 +158,7 @@ func (s *EpochTrustValueStorage) Iterate(h reputation.TrustHandler) (err error) t := reputation.Trust{} t.SetPeer(peerIDFromString(strID)) - t.SetValue(val) + t.SetValue(val.Div(sum)) if err = h(t); err != nil { break