diff --git a/geth/node/manager.go b/geth/node/manager.go index 1ffc845c959..0e4c9d3be74 100644 --- a/geth/node/manager.go +++ b/geth/node/manager.go @@ -136,17 +136,20 @@ func (m *NodeManager) StopNode() (<-chan struct{}, error) { m.Lock() defer m.Unlock() - return m.stopNode() -} - -// stopNode stop Status node. Stopped node cannot be resumed. -func (m *NodeManager) stopNode() (<-chan struct{}, error) { if err := m.isNodeAvailable(); err != nil { return nil, err } + if m.nodeStopped == nil { + return nil, ErrNoRunningNode + } <-m.nodeStarted // make sure you operate on fully started node + return m.stopNode() +} + +// stopNode stop Status node. Stopped node cannot be resumed. +func (m *NodeManager) stopNode() (<-chan struct{}, error) { // now attempt to stop if err := m.node.Stop(); err != nil { return nil, err