commands: reverse_swap: don't require provider_mining_fee in dryrun
What changed, and why it matters
This commit fixes a small user-interface bug in Electrum's command-line reverse-swap command. It makes the provider_mining_fee argument optional during a 'dryrun' preview, and corrects a typo in an error message. There is no direct evidence this is a security vulnerability.
No security action required; treat as normal usability/bug-fix commit.
Security signals we found
No security-relevant code change: only argument default and error-message typo fixed
Assertion guarding real swap execution remains intact
No input validation, cryptographic, or authorization changes
Evidence from the diff
The patch changes the reverse_swap RPC/command so that provider_mining_fee defaults to the string ‘dryrun’ instead of being a required positional argument. This lets users run a dry-run preview without supplying a real fee. The same assertion still blocks using ‘dryrun’ when executing the actual swap, so the real swap path remains unchanged. A typo in the assertion message (‘provder_mining_fee’ -> ‘provider_mining_fee’) is also fixed.
Changed components
electrum/commands.pyreverse_swap CLI/RPC commandInspect captured patch +4 / −2
diff --git a/electrum/commands.py b/electrum/commands.py
index 73f8ce3..4639a5e 100644
--- a/electrum/commands.py
+++ b/electrum/commands.py
@@ -2002,7 +2002,9 @@ class Commands(Logger):
}
@command('wnpl')
- async def reverse_swap(self, lightning_amount, onchain_amount, provider_mining_fee, password=None, wallet: Abstract_Wallet = None):
+ async def reverse_swap(
+ self, lightning_amount, onchain_amount, provider_mining_fee='dryrun', password=None, wallet: Abstract_Wallet = None,
+ ):
"""
Reverse submarine swap: send on Lightning, receive on-chain
@@ -2029,7 +2031,7 @@ class Commands(Logger):
lightning_amount_sat = satoshis(lightning_amount)
claim_fee = sm.get_fee_for_txbatcher()
onchain_amount_sat = satoshis(onchain_amount) + claim_fee
- assert provider_mining_fee != "dryrun", "Provide the 'provder_mining_fee' obtained from the dryrun."
+ assert provider_mining_fee != "dryrun", "Provide the 'provider_mining_fee' obtained from the dryrun."
provider_mining_fee = satoshis(provider_mining_fee)
funding_txid = await wallet.lnworker.swap_manager.reverse_swap(
transport=transport,
Why this scored 18/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.