What changed, and why it matters
This commit is a simple code cleanup: it replaces a hardcoded number (20,000 satoshis) with a named constant variable. The actual value and behavior are unchanged. There is no security issue here.
No action needed. This is a benign refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces a module-level constant MIN_SWAP_AMOUNT_SAT = 20_000 in electrum/submarine_swaps.py and replaces the literal 20000 in SwapManager.server_update_pairs() with that constant. It is a pure refactoring change with no functional difference.
Changed components
electrum/submarine_swaps.pyInspect captured patch +2 / −1
diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py
index f0e84c5..5174ef7 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)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.