Skip to content

Commit

Permalink
update the default block explorer for users upgrading from a version …
Browse files Browse the repository at this point in the history
…< 5.1.5

If the user selected BitcoinABC as the block explorer, migrate to eCash instead.
  • Loading branch information
PiRK committed Sep 2, 2022
1 parent ffa7afb commit d79934a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions electroncash/migrate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
The first time a user runs this program, if he already uses Electron Cash,
he should be able to see all his BCH wallets and have some of the
settings imported.
This module also handles updating the config file when default config parameters are
changed.
"""
import glob
import logging
Expand Down Expand Up @@ -215,6 +218,12 @@ def update_config():
_logger.info(f"Deleting exchange cache data {fname}")
safe_rm(fname)

# Change default block explorer from bitcoinabc.org to e.cash
if tuple(config_version) <= (5, 1, 4) and "block_explorer" in config:
if config["block_explorer"] == "BitcoinABC":
_logger.info("Updating default block explorer to explorer.e.cash")
config["block_explorer"] = "eCash"

# update version number, to avoid doing this again for this version
config["latest_version_used"] = VERSION_TUPLE
save_user_config(config, get_user_dir())

0 comments on commit d79934a

Please sign in to comment.