Browse Source
Merge pull request #7396 from MrNaif2018/fix/jsonrpc-lockfile-cleanup
Don't cleanup lockfile if listen_jsonrpc is False
patch-4
ghost43
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
electrum/daemon.py
|
|
@ -414,6 +414,7 @@ class Daemon(Logger): |
|
|
|
def __init__(self, config: SimpleConfig, fd=None, *, listen_jsonrpc=True): |
|
|
|
Logger.__init__(self) |
|
|
|
self.config = config |
|
|
|
self.listen_jsonrpc = listen_jsonrpc |
|
|
|
if fd is None and listen_jsonrpc: |
|
|
|
fd = get_file_descriptor(config) |
|
|
|
if fd is None: |
|
|
@ -567,8 +568,9 @@ class Daemon(Logger): |
|
|
|
fut = asyncio.run_coroutine_threadsafe(stop_async(), self.asyncio_loop) |
|
|
|
fut.result() |
|
|
|
finally: |
|
|
|
self.logger.info("removing lockfile") |
|
|
|
remove_lockfile(get_lockfile(self.config)) |
|
|
|
if self.listen_jsonrpc: |
|
|
|
self.logger.info("removing lockfile") |
|
|
|
remove_lockfile(get_lockfile(self.config)) |
|
|
|
self.logger.info("stopped") |
|
|
|
self.asyncio_loop.call_soon_threadsafe(self.stopped_event.set) |
|
|
|
|
|
|
|