diff --git a/pkg/innerring/processors/netmap/process_peers.go b/pkg/innerring/processors/netmap/process_peers.go index 1aece64418..b8da130786 100644 --- a/pkg/innerring/processors/netmap/process_peers.go +++ b/pkg/innerring/processors/netmap/process_peers.go @@ -28,13 +28,16 @@ func (np *Processor) processAddPeer(node []byte) { return } + keyString := hex.EncodeToString(nodeInfo.PublicKey) np.log.Info("approving network map candidate", - zap.String("key", hex.EncodeToString(nodeInfo.PublicKey)), - ) + zap.String("key", keyString)) - err = invoke.ApprovePeer(np.morphClient, np.netmapContract, node) - if err != nil { - np.log.Error("can't invoke netmap.AddPeer", zap.Error(err)) + exists := np.netmapSnapshot.touch(keyString, np.epochState.EpochCounter()) + if !exists { + err = invoke.ApprovePeer(np.morphClient, np.netmapContract, node) + if err != nil { + np.log.Error("can't invoke netmap.AddPeer", zap.Error(err)) + } } }