def checkshutdown(self):
        nc = self.getnodecount()
        # TODO: this doesn't consider slave server node counts
        # wait for slave servers to enter SHUTDOWN state, then master session
        # can enter SHUTDOWN
        replies = ()
        if self.getcfgitembool('verbose', False):
            self.info("Session %d shutdown: %d nodes remaining" % \
                      (self.sessionid, nc))
        if nc == 0:
            replies = self.setstate(state=coreapi.CORE_EVENT_SHUTDOWN_STATE,
                                    info=True, sendevent=True, returnevent=True)
            self.sdt.shutdown()
        return replies
Check if we have entered the shutdown state, when no running nodes
dataset/ETHPy150Open coreemu/core/daemon/core/session.py/Session.checkshutdown