From 23cd48c6b54d9cc716fd3acb034c7e628a867db3 Mon Sep 17 00:00:00 2001 From: lash Date: Wed, 20 Mar 2019 12:53:56 +0100 Subject: [PATCH] p2p/simulation: Move init enode comment --- p2p/simulations/adapters/inproc.go | 2 -- p2p/simulations/adapters/types.go | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index 682e48530b..fc9244ff86 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -92,8 +92,6 @@ func (s *SimAdapter) NewNode(config *NodeConfig) (Node, error) { } } - // set up ENR record - // err := config.initDefaultEnode() if err != nil { return nil, err diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index e3e17f608b..132b7885ec 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -267,10 +267,8 @@ func RegisterServices(services Services) { } } -func (n *NodeConfig) initDefaultEnode() error { - return n.initEnode(net.IPv4(127, 0, 0, 1), 0, 0) -} - +// adds the host part to the configuration's ENR, signs it +// creates and the corresponding enode object to the configuration func (n *NodeConfig) initEnode(ip net.IP, tcpport int, udpport int) error { enrIp := enr.IP(ip) n.Record.Set(&enrIp) @@ -291,3 +289,7 @@ func (n *NodeConfig) initEnode(ip net.IP, tcpport int, udpport int) error { n.node = nod return nil } + +func (n *NodeConfig) initDefaultEnode() error { + return n.initEnode(net.IPv4(127, 0, 0, 1), 0, 0) +}