From 0c73074bf7fd7495140f73c80b7eab68e86136ca Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 10 Jun 2020 15:41:12 +0100 Subject: [PATCH] Close wallet when WalletService is stopped. Fixes #594. --- jmclient/jmclient/wallet_service.py | 5 ++++- scripts/joinmarket-qt.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jmclient/jmclient/wallet_service.py b/jmclient/jmclient/wallet_service.py index 92d99cc..c5d9206 100644 --- a/jmclient/jmclient/wallet_service.py +++ b/jmclient/jmclient/wallet_service.py @@ -91,9 +91,12 @@ class WalletService(Service): def stopService(self): """ Encapsulates shut down actions. - Here shut down main tx monitoring loop. + Note that after the service is stopped, it + should *not* be restarted, instead a new + WalletService instance should be created. """ self.monitor_loop.stop() + self.wallet.close() super(WalletService, self).stopService() def isRunning(self): diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index 8113593..8513bd1 100755 --- a/scripts/joinmarket-qt.py +++ b/scripts/joinmarket-qt.py @@ -1754,6 +1754,7 @@ class JMMainWindow(QMainWindow): self.wallet_service.autofreeze_warning_cb = self.autofreeze_warning_cb self.wallet_service.startService() + self.syncmsg = "" self.walletRefresh = task.LoopingCall(self.updateWalletInfo) self.walletRefresh.start(5.0)