[#383] innerring: Marshal node info back after validation

Node info validator may change node attributes, e.g. update
it with human-readable location attributes based on LOCODE.
So inner ring node should provide new node info binary to
smart contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-02-11 13:43:01 +03:00 committed by Alex Vanin
parent 6cb906ab5f
commit 058ab0e533

View file

@ -35,6 +35,14 @@ func (np *Processor) processAddPeer(node []byte) {
return
}
// marshal node info back to binary
node, err = nodeInfo.Marshal()
if err != nil {
np.log.Warn("can't marshal approved network map candidate",
zap.String("error", err.Error()))
return
}
keyString := hex.EncodeToString(nodeInfo.PublicKey())
exists := np.netmapSnapshot.touch(keyString, np.epochState.EpochCounter())