commit 861e77e4195dc96bda47afe909d5338bc98f140c
parent e80137f8d5d521d50401ab6f5fc3a031775b13df
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date: Fri, 7 Sep 2018 13:38:11 +0100
Fix crash bug due to new RPC behaving differently
The RPC call getaddressesbylabel gives an error if a non-existant label
is queried, which is different to getaddressesbyaccount which just
returns an empty list. This caused a crash bug.
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/server.py b/server.py
@@ -389,8 +389,12 @@ def get_scriptpubkeys_to_monitor(rpc, config):
debug("using deprecated accounts interface")
except JsonRpcError:
#bitcoin core 0.17 deprecates accounts, replaced with labels
- imported_addresses = set(rpc.call("getaddressesbylabel",
- [transactionmonitor.ADDRESSES_LABEL]).keys())
+ if transactionmonitor.ADDRESSES_LABEL in rpc.call("listlabels", []):
+ imported_addresses = set(rpc.call("getaddressesbylabel",
+ [transactionmonitor.ADDRESSES_LABEL]).keys())
+ else:
+ #no label, no addresses imported at all
+ imported_addresses = set()
debug("already-imported addresses = " + str(imported_addresses))
deterministic_wallets = []