mirror of https://github.com/status-im/op-geth.git
node: rename startNetworking to openEndpoints (#22105)
This commit is contained in:
parent
47820ef726
commit
5c2a7ce2cc
11
node/node.go
11
node/node.go
|
@ -159,12 +159,13 @@ func (n *Node) Start() error {
|
||||||
return ErrNodeStopped
|
return ErrNodeStopped
|
||||||
}
|
}
|
||||||
n.state = runningState
|
n.state = runningState
|
||||||
err := n.startNetworking()
|
// open networking and RPC endpoints
|
||||||
|
err := n.openEndpoints()
|
||||||
lifecycles := make([]Lifecycle, len(n.lifecycles))
|
lifecycles := make([]Lifecycle, len(n.lifecycles))
|
||||||
copy(lifecycles, n.lifecycles)
|
copy(lifecycles, n.lifecycles)
|
||||||
n.lock.Unlock()
|
n.lock.Unlock()
|
||||||
|
|
||||||
// Check if networking startup failed.
|
// Check if endpoint startup failed.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
n.doClose(nil)
|
n.doClose(nil)
|
||||||
return err
|
return err
|
||||||
|
@ -247,12 +248,14 @@ func (n *Node) doClose(errs []error) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// startNetworking starts all network endpoints.
|
// openEndpoints starts all network and RPC endpoints.
|
||||||
func (n *Node) startNetworking() error {
|
func (n *Node) openEndpoints() error {
|
||||||
|
// start networking endpoints
|
||||||
n.log.Info("Starting peer-to-peer node", "instance", n.server.Name)
|
n.log.Info("Starting peer-to-peer node", "instance", n.server.Name)
|
||||||
if err := n.server.Start(); err != nil {
|
if err := n.server.Start(); err != nil {
|
||||||
return convertFileLockError(err)
|
return convertFileLockError(err)
|
||||||
}
|
}
|
||||||
|
// start RPC endpoints
|
||||||
err := n.startRPC()
|
err := n.startRPC()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
n.stopRPC()
|
n.stopRPC()
|
||||||
|
|
Loading…
Reference in New Issue