Skip to content

Commit

Permalink
Tolerate 0.17 which deprecates accounts feature
Browse files Browse the repository at this point in the history
Bitcoin Core 0.17 deprecates the accounts feature and replaces it with
labels. See issue #22.
  • Loading branch information
chris-belcher committed Sep 1, 2018
1 parent 839c222 commit 74a4390
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 74a4390

Please sign in to comment.