swaps: rm until filter when fetching server pairs
What changed, and why it matters
This commit removes an 'until' time limit when Electrum asks a Nostr relay for swap server advertisements. Previously, if a user left the swap dialog open for more than an hour, the 'until' timestamp would expire and the relay would stop sending newly created swap server events, causing the client to miss live server offers. The fix keeps a 'since' window and still validates event timestamps when parsing, so backdated or pre-dated events are rejected. It is a reliability/availability fix for swap discovery rather than a cryptographic or theft bug.
Treat as a routine bugfix. Users who perform submarine swaps should upgrade to a version containing this commit to avoid stale or missing swap server offers. No immediate incident response is indicated.
Security signals we found
Time-window filter caused denial of live swap-server advertisements
Remaining timestamp sanity check in event parsing loop mitigates pre/backdating
Fixes reported issue #10520
No cryptographic, key-handling, or payment-flow code changed
Evidence from the diff
In electrum/submarine_swaps.py, the Nostr subscription filter used to include ‘until’: int(time.time()) + 60 * 60. Because the filter is created once when the dialog opens, any swap-server event created more than an hour later would fall after ‘until’ and not be delivered. Removing ‘until’ lets the subscription keep receiving new events. The event parsing loop still compares event timestamps to the current time, acting as a sanity check against pre/backdating. The change is one line removed; no new validation is added.
Changed components
electrum/submarine_swaps.pyNostrTransport.get_events subscription filterSwap server discovery over Nostr relayInspect captured patch +0 / −1
diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py
index 1a76123..c320a10 100644
--- a/electrum/submarine_swaps.py
+++ b/electrum/submarine_swaps.py
@@ -1847,7 +1847,6 @@ class NostrTransport(SwapServerTransport):
"#d": [f"electrum-swapserver-{self.NOSTR_EVENT_VERSION}"],
"#r": [f"net:{constants.net.NET_NAME}"],
"since": int(time.time()) - 60 * 60,
- "until": int(time.time()) + 60 * 60,
}
async for event in self.relay_manager.get_events(query, single_event=False, only_stored=False):
try:
Why this scored 36/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.