From fc9cb0ca1c29eaf5400b864270d5514dbe3abd8e Mon Sep 17 00:00:00 2001 From: Yuki Inoue Date: Wed, 7 Mar 2018 13:51:06 +0900 Subject: [PATCH] daemon status shows current wallet path All the jsonrpc calls against electrum daemon is affected by the implicit parameter of wallet in the cmd_runner. AFAIK, there is no way to check the value of this wallet. This can be trouble some if multiple wallets are loaded, or load_wallet command is executed several times. This patch makes it viewable on the `daemon status`. --- lib/daemon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/daemon.py b/lib/daemon.py index b3242215e..5bfa2fdf8 100644 --- a/lib/daemon.py +++ b/lib/daemon.py @@ -185,6 +185,9 @@ class Daemon(DaemonThread): elif sub == 'status': if self.network: p = self.network.get_parameters() + current_wallet = self.cmd_runner.wallet + current_wallet_path = current_wallet.storage.path \ + if current_wallet else None response = { 'path': self.network.config.path, 'server': p[0], @@ -196,6 +199,7 @@ class Daemon(DaemonThread): 'version': ELECTRUM_VERSION, 'wallets': {k: w.is_up_to_date() for k, w in self.wallets.items()}, + 'current_wallet': current_wallet_path, 'fee_per_kb': self.config.fee_per_kb(), } else: