From 2c67c5e1e5859d72c3fdbee9c235443674e0933e Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 1 Sep 2025 10:09:33 +0200 Subject: [PATCH] swaps: make min swap amount a const var instead of hardcoding 20_000 sat directly in the code, make MIN_SWAP_AMOUNT_SAT a const variable outside of SwapManager so it can be used for other code too. --- electrum/submarine_swaps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index f0e84c56c..5174ef738 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -59,6 +59,7 @@ if TYPE_CHECKING: SWAP_TX_SIZE = 150 # default tx size, used for mining fee estimation +MIN_SWAP_AMOUNT_SAT = 20_000 MIN_LOCKTIME_DELTA = 60 LOCKTIME_DELTA_REFUND = 70 MAX_LOCKTIME_DELTA = 100 @@ -1128,7 +1129,7 @@ class SwapManager(Logger): def server_update_pairs(self) -> None: """ for server """ self.percentage = float(self.config.SWAPSERVER_FEE_MILLIONTHS) / 10000 # type: ignore - self._min_amount = 20000 + self._min_amount = MIN_SWAP_AMOUNT_SAT oc_balance_sat: int = self.wallet.get_spendable_balance_sat() max_forward: int = min(int(self.lnworker.num_sats_can_receive()), oc_balance_sat, 10000000) max_reverse: int = min(int(self.lnworker.num_sats_can_send()), 10000000)