p2p/simulation: Move init enode comment

This commit is contained in:
lash 2019-03-20 12:53:56 +01:00
parent 9e168075b6
commit 23cd48c6b5
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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)
}