mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/simulation: Move init enode comment
This commit is contained in:
parent
9e168075b6
commit
23cd48c6b5
2 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue