pass config.path to daemon (exemptore). fixes #901
This commit is contained in:
1
electrum
1
electrum
@@ -276,6 +276,7 @@ if __name__ == '__main__':
|
|||||||
network.start()
|
network.start()
|
||||||
if arg == 'status':
|
if arg == 'status':
|
||||||
print_json({
|
print_json({
|
||||||
|
'path': network.config.path,
|
||||||
'server': network.get_parameters()[0],
|
'server': network.get_parameters()[0],
|
||||||
'blockchain_height': network.get_local_height(),
|
'blockchain_height': network.get_local_height(),
|
||||||
'server_height': network.get_server_height(),
|
'server_height': network.get_server_height(),
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ DAEMON_SOCKET = 'daemon.sock'
|
|||||||
|
|
||||||
def do_start_daemon(config):
|
def do_start_daemon(config):
|
||||||
import subprocess
|
import subprocess
|
||||||
|
args = [sys.executable, __file__, config.path]
|
||||||
logfile = open(os.path.join(config.path, 'daemon.log'),'w')
|
logfile = open(os.path.join(config.path, 'daemon.log'),'w')
|
||||||
p = subprocess.Popen([sys.executable,__file__], stderr=logfile, stdout=logfile, close_fds=(os.name=="posix"))
|
p = subprocess.Popen(args, stderr=logfile, stdout=logfile, close_fds=(os.name=="posix"))
|
||||||
print_stderr("starting daemon (PID %d)"%p.pid)
|
print_stderr("starting daemon (PID %d)"%p.pid)
|
||||||
|
|
||||||
|
|
||||||
@@ -207,7 +208,10 @@ def daemon_loop(server):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import simple_config, util
|
import simple_config, util
|
||||||
config = simple_config.SimpleConfig()
|
_config = {}
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
_config['electrum_path'] = sys.argv[1]
|
||||||
|
config = simple_config.SimpleConfig(_config)
|
||||||
util.set_verbosity(True)
|
util.set_verbosity(True)
|
||||||
server = NetworkServer(config)
|
server = NetworkServer(config)
|
||||||
server.start()
|
server.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user