From 0936f9b5f210a7886af89ebd92a1d24ca2da7957 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Thu, 25 Jun 2015 17:34:01 -0400 Subject: [PATCH] Fix #95 CLI wallet crash on exit --- libraries/wallet/wallet.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 1b0a1699..0054850c 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -312,7 +312,18 @@ public: } virtual ~wallet_api_impl() { - _remote_db->cancel_all_subscriptions(); + try + { + _remote_db->cancel_all_subscriptions(); + } + catch (const fc::exception& e) + { + // Right now the wallet_api has no way of knowing if the connection to the + // witness has already disconnected (via the witness node exiting first). + // If it has exited, cancel_all_subscriptsions() will throw and there's + // nothing we can do about it. + // dlog("Caught exception ${e} while canceling database subscriptions", ("e", e)); + } } void encrypt_keys()