submarine_swaps: fix swapserver dying taskgroup (follow-up 21e3fd91dd and 4490bd3a76)
What changed, and why it matters
This is a tiny one-line fix in Electrum's submarine swap server code. It corrects a function call that was accidentally passing an extra empty argument, which could cause the background task handling swap-server messages to crash. A crashing background task is a reliability issue and could briefly affect swap service availability, but it does not appear to let an attacker steal funds or run malicious code directly.
Apply the patch. Monitor related taskgroup handling in submarine_swaps.py for similar argument mismatches or unhandled exceptions that could terminate long-running services. No urgent security response appears needed beyond normal code review and testing.
Security signals we found
Background service taskgroup crash (denial-of-service-like reliability issue)
Incorrect positional argument to internal message-sending method
Follow-up to prior commits 21e3fd91dd and 4490bd3a76, suggesting ongoing hardening of taskgroup lifecycle
Evidence from the diff
In electrum/submarine_swaps.py, NostrTransport’s message handler calls send_direct_message(event.pubkey, [], error_response). The method signature apparently expects send_direct_message(pubkey, message), so the extra empty list [] is a positional argument mismatch. The patch removes the [] so the call matches the expected signature. The commit title frames this as ‘fix swapserver dying taskgroup’, implying the bad call was raising an unhandled exception that killed the task group running the swap server.
Changed components
electrum/submarine_swaps.pyNostrTransport.send_direct_messageswap server taskgroupInspect captured patch +1 / −1
diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py
index c65f747..aa5399c 100644
--- a/electrum/submarine_swaps.py
+++ b/electrum/submarine_swaps.py
@@ -1725,7 +1725,7 @@ class NostrTransport(SwapServerTransport):
"error": str(e)[:100],
"reply_to": event.id,
})
- await self.send_direct_message(event.pubkey,[], error_response)
+ await self.send_direct_message(event.pubkey, error_response)
else:
self.logger.info(f'unknown message {content}')
Why this scored 19/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.