daemon
This commit is contained in:
15
electrum
15
electrum
@@ -121,7 +121,7 @@ def run_command(cmd, password=None, args=[]):
|
||||
try:
|
||||
result = func(*args[1:])
|
||||
except socket.error:
|
||||
print "Network server not found."
|
||||
print "Daemon not running"
|
||||
sys.exit(1)
|
||||
except Exception:
|
||||
traceback.print_exc(file=sys.stdout)
|
||||
@@ -222,9 +222,6 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if cmd.name in ['create', 'restore']:
|
||||
if storage.file_exists:
|
||||
sys.exit("Error: Remove the existing wallet first!")
|
||||
@@ -370,7 +367,7 @@ if __name__ == '__main__':
|
||||
args = args[0:cmd.min_args] + [message]
|
||||
|
||||
|
||||
if cmd.name == 'start_network':
|
||||
if cmd.name == 'daemon' and args[1] == 'start':
|
||||
pid = os.fork()
|
||||
if (pid == 0): # The first child.
|
||||
os.chdir("/")
|
||||
@@ -397,13 +394,9 @@ if __name__ == '__main__':
|
||||
server.running = True
|
||||
while server.running:
|
||||
server.handle_request()
|
||||
print_msg("Server stopped")
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(0)
|
||||
print_msg("Daemon stopped")
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
# run the command
|
||||
if cmd.name == 'deseed':
|
||||
|
||||
Reference in New Issue
Block a user