[#146] netmap: allow to update peer info

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-16 12:57:45 +03:00 committed by Alex Vanin
parent 7fe7188e7d
commit a72392f672
3 changed files with 64 additions and 6 deletions

View file

@ -191,6 +191,7 @@ func UpdateInnerRing(keys []interop.PublicKey) {
// by Alphabet node. If it was invoked by node candidate, it produces AddPeer
// notification. Otherwise method throws panic.
//
// If the candidate already exists, it's info is updated.
// NodeInfo argument contains stable marshaled version of netmap.NodeInfo
// structure.
func AddPeer(nodeInfo []byte) {
@ -519,11 +520,6 @@ func addToNetmap(ctx storage.Context, n storageNode) {
}
)
data := storage.Get(ctx, storageKey)
if data != nil {
return
}
storage.Put(ctx, storageKey, std.Serialize(node))
}