diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index da2b711..c3b6554 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -5398,7 +5398,7 @@ class BasicSwap(BaseApp): finally: self._updating_wallets_info[int(coin)] = False - def updateWalletsInfo(self, force_update=False, only_coin=None): + def updateWalletsInfo(self, force_update=False, only_coin=None, wait_for_complete=False): now = int(time.time()) if not force_update and now - self._last_updated_wallets_info < 30: return @@ -5407,11 +5407,18 @@ class BasicSwap(BaseApp): continue if c not in chainparams: continue - if self.coin_clients[c]['connection_type'] == 'rpc': + cc = self.coin_clients[c] + if cc['connection_type'] == 'rpc': + if not force_update and now - cc.get('last_updated_wallet_info', 0) < 30: + return + cc['last_updated_wallet_info'] = int(time.time()) self._updating_wallets_info[int(c)] = True - self.thread_pool.submit(self.updateWalletInfo, c) - if only_coin is None: - self._last_updated_wallets_info = int(time.time()) + handle = self.thread_pool.submit(self.updateWalletInfo, c) + if wait_for_complete: + try: + handle.result(timeout=10) + except Exception as e: + self.log.error(f'updateWalletInfo {e}') def getWalletsInfo(self, opts=None): rv = {} diff --git a/basicswap/http_server.py b/basicswap/http_server.py index de6445a..dad5527 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -146,7 +146,7 @@ class HttpHandler(BaseHTTPRequestHandler): template = env.get_template('info.html') return self.render_simple_template(template, { 'title_str': 'BasicSwap Info', - 'message_str': error_str, + 'message_str': info_str, }) def page_error(self, error_str): @@ -780,6 +780,8 @@ class HttpHandler(BaseHTTPRequestHandler): return page_automation_strategy_new(self, url_split, post_string) if page == 'shutdown': return self.page_shutdown(url_split, post_string) + if page != '': + return self.page_404(url_split) return self.page_index(url_split) except Exception as ex: if self.server.swap_client.debug is True: diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index 9b418a2..5612695 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -1,6 +1,5 @@ {% include 'header.html' %} -
@@ -10,7 +9,7 @@ {% endif %} {% for m in messages %} -{{ m }}
+{{ m }}
{% endfor %}