From 2de39443be8371c55ce43712f6750eb64853052e Mon Sep 17 00:00:00 2001 From: Artur <33733651+Keeqler@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:49:37 -0300 Subject: [PATCH] fix(autoforward): proper workaround for when having an open wallet on script start --- src/util.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/util.py b/src/util.py index 8f03ef1..0979fbe 100644 --- a/src/util.py +++ b/src/util.py @@ -104,15 +104,12 @@ def wait_for_wallets(): print('Waiting for Monero wallet...') - while 1: + while 1: try: - request_monero_rpc('get_balance', {'account_index': 0}) - break - except Exception as e: - error = ast.literal_eval(str(e)) - if not (isinstance(error, dict) and error.get('error', {}).get('message')): - raise e - + request_monero_rpc('close_wallet') + except: + pass + try: open_monero_wallet() break