forked from TrueCloudLab/frostfs-node
[#488] reputation/local/storage: Add trusting peer
Fix iteration logic after adding trusting peer in `Trust` struct. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
dbff8e9b3f
commit
d3c1fc7dda
3 changed files with 3 additions and 4 deletions
|
@ -81,6 +81,7 @@ func (it *TrustIterator) Iterate(h reputation.TrustHandler) error {
|
||||||
trust := reputation.Trust{}
|
trust := reputation.Trust{}
|
||||||
trust.SetPeer(reputation.PeerIDFromBytes(nm.Nodes[i].PublicKey()))
|
trust.SetPeer(reputation.PeerIDFromBytes(nm.Nodes[i].PublicKey()))
|
||||||
trust.SetValue(p)
|
trust.SetValue(p)
|
||||||
|
trust.SetTrustingPeer(reputation.PeerIDFromBytes(it.storage.LocalKey))
|
||||||
|
|
||||||
if err := h(trust); err != nil {
|
if err := h(trust); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -47,7 +47,7 @@ type EpochTrustValueStorage struct {
|
||||||
|
|
||||||
func newTrustValueStorage() *EpochTrustValueStorage {
|
func newTrustValueStorage() *EpochTrustValueStorage {
|
||||||
return &EpochTrustValueStorage{
|
return &EpochTrustValueStorage{
|
||||||
mItems: make(map[string]*trustValue, 1),
|
mItems: make(map[string]*trustValue, 1),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,7 @@ import (
|
||||||
// All values must comply with the requirements imposed on them.
|
// All values must comply with the requirements imposed on them.
|
||||||
// Passing incorrect parameter values will result in constructor
|
// Passing incorrect parameter values will result in constructor
|
||||||
// failure (error or panic depending on the implementation).
|
// failure (error or panic depending on the implementation).
|
||||||
//
|
type Prm struct {}
|
||||||
// The component is not parameterizable at the moment.
|
|
||||||
type Prm struct{}
|
|
||||||
|
|
||||||
// Storage represents in-memory storage of
|
// Storage represents in-memory storage of
|
||||||
// local reputation values.
|
// local reputation values.
|
||||||
|
|
Loading…
Reference in a new issue