From 52b046c9b6a0f6a280ff797f90784f76bfd310b9 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 18 Apr 2018 12:27:20 +0200 Subject: 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. --- node/node.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'node/node.go') 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) -- cgit v1.2.3