commit 74a439072dc2c54488dd673f98e4ba22f75bb995
parent 839c222880efce312363a89068c6cd724c3b267b
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date: Sat, 1 Sep 2018 23:30:33 +0100
Tolerate 0.17 which deprecates accounts feature
Bitcoin Core 0.17 deprecates the accounts feature and replaces it with
labels. See issue #22.
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/server.py b/server.py
@@ -383,8 +383,14 @@ def run_electrum_server(rpc, txmonitor, hostport, ip_whitelist,
def get_scriptpubkeys_to_monitor(rpc, config):
log("Obtaining bitcoin addresses to monitor . . .")
st = time.time()
- imported_addresses = set(rpc.call("getaddressesbyaccount",
- [transactionmonitor.ADDRESSES_LABEL]))
+ try:
+ imported_addresses = set(rpc.call("getaddressesbyaccount",
+ [transactionmonitor.ADDRESSES_LABEL]))
+ 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())
debug("already-imported addresses = " + str(imported_addresses))
deterministic_wallets = []