Add upgradecores function to prepare script. (#213)

* Add upgradecores function to prepare script.

Differences from preparebinonly:

- If with/withoutcoins isn't set
  - Read list of coins to update from basicswap.json
    - Only where manage_daemon or manage_wallet_daemon is true
- Store core version no in basicswap.json
  - Only update if missing or differs.
- Writes core_version_no and core_version_group to basicswap.json
  - Per core updated
  - Backup old config to timestamped file

* Upgrade unmanaged coin cores by default.

Disable with BSX_UPDATE_UNMANAGED.
This commit is contained in:
tecnovert
2025-01-13 23:28:32 +00:00
committed by GitHub
parent 159974d414
commit ab04f27497
2 changed files with 121 additions and 21 deletions

View File

@@ -223,7 +223,7 @@ def getWalletBinName(coin_id: int, coin_settings, default_name: str) -> str:
) + (".exe" if os.name == "nt" else "")
def getCoreBinArgs(coin_id: int, coin_settings):
def getCoreBinArgs(coin_id: int, coin_settings, prepare=False):
extra_args = []
if "config_filename" in coin_settings:
extra_args.append("--conf=" + coin_settings["config_filename"])
@@ -234,7 +234,7 @@ def getCoreBinArgs(coin_id: int, coin_settings):
# As BCH may use port 8334, disable it here.
# When tor is enabled a bind option for the onionport will be added to bitcoin.conf.
# https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-28.0.md?plain=1#L84
if coin_id == Coins.BTC:
if not prepare and coin_id == Coins.BTC:
port: int = coin_settings.get("port", 8333)
extra_args.append(f"--bind=0.0.0.0:{port}")
return extra_args