mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/network/simulation: improve New function comment
This commit is contained in:
parent
5d80a1b665
commit
f0da48c19a
1 changed files with 4 additions and 0 deletions
|
|
@ -68,6 +68,10 @@ type ServiceFunc func(ctx *adapters.ServiceContext, bucket *sync.Map) (s node.Se
|
||||||
|
|
||||||
// New creates a new Simulation instance with new
|
// New creates a new Simulation instance with new
|
||||||
// simulations.Network initialized with provided services.
|
// 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) {
|
func New(services map[string]ServiceFunc) (s *Simulation) {
|
||||||
s = &Simulation{
|
s = &Simulation{
|
||||||
buckets: make(map[enode.ID]*sync.Map),
|
buckets: make(map[enode.ID]*sync.Map),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue