Browse Source
daemon: more convenient constructor for scripts
3.3.3.1
SomberNight
7 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
4 additions and
1 deletions
-
electrum/daemon.py
|
@ -121,9 +121,12 @@ def get_rpc_credentials(config): |
|
|
|
|
|
|
|
|
class Daemon(DaemonThread): |
|
|
class Daemon(DaemonThread): |
|
|
|
|
|
|
|
|
def __init__(self, config, fd): |
|
|
def __init__(self, config, fd=None): |
|
|
DaemonThread.__init__(self) |
|
|
DaemonThread.__init__(self) |
|
|
self.config = config |
|
|
self.config = config |
|
|
|
|
|
if fd is None: |
|
|
|
|
|
fd, server = get_fd_or_server(config) |
|
|
|
|
|
if fd is None: raise Exception('failed to lock daemon; already running?') |
|
|
if config.get('offline'): |
|
|
if config.get('offline'): |
|
|
self.network = None |
|
|
self.network = None |
|
|
else: |
|
|
else: |
|
|