From f0da48c19a82f2477f92f2b672f6c81130bd7823 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Thu, 22 Nov 2018 10:38:08 +0100 Subject: [PATCH] swarm/network/simulation: improve New function comment --- swarm/network/simulation/simulation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swarm/network/simulation/simulation.go b/swarm/network/simulation/simulation.go index f6d3ce2290..46133aaddf 100644 --- a/swarm/network/simulation/simulation.go +++ b/swarm/network/simulation/simulation.go @@ -68,6 +68,10 @@ type ServiceFunc func(ctx *adapters.ServiceContext, bucket *sync.Map) (s node.Se // New creates a new Simulation instance with new // simulations.Network initialized with provided services. +// Services map must have unique keys as service names and +// every ServiceFunc must return a node.Service of the unique type. +// This restriction is required by node.Node.Start() function +// which is used to start node.Service returned by ServiceFunc. func New(services map[string]ServiceFunc) (s *Simulation) { s = &Simulation{ buckets: make(map[enode.ID]*sync.Map),