aboutsummaryrefslogtreecommitdiffstats
path: root/node/node.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2018-04-18 18:27:20 +0800
committerGitHub <noreply@github.com>2018-04-18 18:27:20 +0800
commit52b046c9b6a0f6a280ff797f90784f76bfd310b9 (patch)
tree709ce3f7e873e47bdac72ab4f9935cf7b3108c4b /node/node.go
parent661f5f3dac23939630e3bf2f9ed2bf1bfb26e990 (diff)
downloaddexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar.gz
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar.bz2
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar.lz
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar.xz
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.tar.zst
dexon-52b046c9b6a0f6a280ff797f90784f76bfd310b9.zip
rpc: clean up IPC handler (#16524)
This avoids logging accept errors on shutdown and removes a bit of duplication. It also fixes some goimports lint warnings.
Diffstat (limited to 'node/node.go')
-rw-r--r--node/node.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/node/node.go b/node/node.go
index bf6e9a7c1..83b6c4c07 100644
--- a/node/node.go
+++ b/node/node.go
@@ -303,23 +303,13 @@ func (n *Node) stopInProc() {
// startIPC initializes and starts the IPC RPC endpoint.
func (n *Node) startIPC(apis []rpc.API) error {
- // Short circuit if the IPC endpoint isn't being exposed
if n.ipcEndpoint == "" {
- return nil
-
- }
- isClosed := func() bool {
- n.lock.RLock()
- defer n.lock.RUnlock()
- return n.ipcListener == nil
+ return nil // IPC disabled.
}
-
- listener, handler, err := rpc.StartIPCEndpoint(isClosed, n.ipcEndpoint, apis)
+ listener, handler, err := rpc.StartIPCEndpoint(n.ipcEndpoint, apis)
if err != nil {
return err
}
-
- // All listeners booted successfully
n.ipcListener = listener
n.ipcHandler = handler
n.log.Info("IPC endpoint opened", "url", n.ipcEndpoint)