debug: Reduce default min_sequence_lock_seconds when debug mode is active.

2024-05-20_merge
tecnovert 2 years ago
parent 468d8c5cc1
commit 9fc4fe3b79
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93
  1. 2
      basicswap/basicswap.py
  2. 5
      basicswap/http_server.py
  3. 2
      doc/install.md

@ -251,7 +251,7 @@ class BasicSwap(BaseApp):
self.min_delay_retry = self.settings.get('min_delay_retry', 60) self.min_delay_retry = self.settings.get('min_delay_retry', 60)
self.max_delay_retry = self.settings.get('max_delay_retry', 5 * 60) self.max_delay_retry = self.settings.get('max_delay_retry', 5 * 60)
self.min_sequence_lock_seconds = self.settings.get('min_sequence_lock_seconds', 1 * 60 * 60) self.min_sequence_lock_seconds = self.settings.get('min_sequence_lock_seconds', 60 if self.debug else (1 * 60 * 60))
self.max_sequence_lock_seconds = self.settings.get('max_sequence_lock_seconds', 96 * 60 * 60) self.max_sequence_lock_seconds = self.settings.get('max_sequence_lock_seconds', 96 * 60 * 60)
self._bid_expired_leeway = 5 self._bid_expired_leeway = 5

@ -124,18 +124,19 @@ class HttpHandler(BaseHTTPRequestHandler):
if swap_client._show_notifications: if swap_client._show_notifications:
args_dict['notifications'] = swap_client.getNotifications() args_dict['notifications'] = swap_client.getNotifications()
# TODO: Remove _withids
if 'messages' in args_dict: if 'messages' in args_dict:
messages_with_ids = [] messages_with_ids = []
for msg in args_dict['messages']: for msg in args_dict['messages']:
messages_with_ids.append((self.server.msg_id_counter, msg)) messages_with_ids.append((self.server.msg_id_counter, msg))
self.server.msg_id_counter += 1 self.server.msg_id_counter += 1
args_dict['messages'] = messages_with_ids args_dict['messages_withids'] = messages_with_ids
if 'err_messages' in args_dict: if 'err_messages' in args_dict:
err_messages_with_ids = [] err_messages_with_ids = []
for msg in args_dict['err_messages']: for msg in args_dict['err_messages']:
err_messages_with_ids.append((self.server.msg_id_counter, msg)) err_messages_with_ids.append((self.server.msg_id_counter, msg))
self.server.msg_id_counter += 1 self.server.msg_id_counter += 1
args_dict['err_messages'] = err_messages_with_ids args_dict['err_messages_withids'] = err_messages_with_ids
if self.server.msg_id_counter >= 0x7FFFFFFF: if self.server.msg_id_counter >= 0x7FFFFFFF:
self.server.msg_id_counter = 0 self.server.msg_id_counter = 0

@ -32,7 +32,7 @@ Without this step you will need to preface each `docker-compose` command with `s
#### Create the images: #### Create the images:
COINDATA_PATH can be set to your preferance but must be exported each time you launch Basicswap.<br> COINDATA_PATH can be set to your preference but must be exported each time you launch Basicswap.<br>
Consider adding COINDATA_PATH to the `.env` file in the docker directory file so it's always set. Consider adding COINDATA_PATH to the `.env` file in the docker directory file so it's always set.
export COINDATA_PATH=/var/data/coinswaps export COINDATA_PATH=/var/data/coinswaps

Loading…
Cancel
Save