From 3f85c7132a76c6cff1c5bf6e1bc702b75d89a312 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 13 Oct 2024 10:21:56 +0200 Subject: [PATCH] swapserver: add config variable SWAPSERVER_FEE_MILLIONTHS --- electrum/simple_config.py | 1 + electrum/submarine_swaps.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/simple_config.py b/electrum/simple_config.py index 23b3c7b1a..1c1d17d3f 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -1204,6 +1204,7 @@ Warning: setting this to too low will result in lots of payment failures."""), SWAPSERVER_URL = ConfigVar('swapserver_url', default=_default_swapserver_url, type_=str) # run submarine swap server locally SWAPSERVER_PORT = ConfigVar('swapserver_port', default=5455, type_=int) + SWAPSERVER_FEE_MILLIONTHS = ConfigVar('swapserver_fee_millionths', default=5000, type_=int) TEST_SWAPSERVER_REFUND = ConfigVar('test_swapserver_refund', default=False, type_=bool) # zeroconf channels diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index 9bfb5d44f..7709abd1e 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -879,7 +879,7 @@ class SwapManager(Logger): def init_pairs(self) -> None: """ for server """ - self.percentage = 0.5 + self.percentage = float(self.config.SWAPSERVER_FEE_MILLIONTHS) / 10000 self._min_amount = 20000 self._max_amount = 10000000 self.normal_fee = self.get_fee(CLAIM_FEE_SIZE)