From b07bc3c4563d023cf0998431e6d078c008bf1fe6 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 30 May 2024 18:55:35 +0200 Subject: [PATCH] Don't start cores for unknown coins. --- bin/basicswap_prepare.py | 8 ++++---- bin/basicswap_run.py | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index f21de26..da7f253 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -1556,24 +1556,24 @@ def main(): particl_wallet_mnemonic = s[1].strip('"') continue if name in ('withcoin', 'withcoins'): - for coin in [s.lower() for s in s[1].split(',')]: + for coin in [s.strip().lower() for s in s[1].split(',')]: ensure_coin_valid(coin) with_coins.add(coin) coins_changed = True continue if name in ('withoutcoin', 'withoutcoins'): - for coin in [s.lower() for s in s[1].split(',')]: + for coin in [s.strip().lower() for s in s[1].split(',')]: ensure_coin_valid(coin, test_disabled=False) with_coins.discard(coin) coins_changed = True continue if name == 'addcoin': - add_coin = s[1].lower() + add_coin = s[1].strip().lower() ensure_coin_valid(add_coin) with_coins = {add_coin, } continue if name == 'disablecoin': - disable_coin = s[1].lower() + disable_coin = s[1].strip().lower() ensure_coin_valid(disable_coin, test_disabled=False) continue if name == 'htmlhost': diff --git a/bin/basicswap_run.py b/bin/basicswap_run.py index 8d51f98..71db102 100755 --- a/bin/basicswap_run.py +++ b/bin/basicswap_run.py @@ -200,15 +200,14 @@ def runClient(fp, data_dir, chain, start_only_coins): try: # Try start daemons for c, v in settings['chainclients'].items(): - if len(start_only_coins) > 0 and c not in start_only_coins: continue try: coin_id = swap_client.getCoinIdFromName(c) display_name = getCoinName(coin_id) except Exception as e: - logger.warning('Error getting coin display name for {}: {}'.format(c, str(e))) - display_name = 'Unknown' + logger.warning('Not starting unknown coin: {}'.format(c)) + continue if c == 'monero': if v['manage_daemon'] is True: swap_client.log.info(f'Starting {display_name} daemon')