AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 17 Bitcoin

bug: psbt_nostr: set CosignerWallet.pending on aio loop

Public commit record

What the developer wrote

Authored by f321x

73/100 · Adequate
bug: psbt_nostr: set CosignerWallet.pending on aio loop

Fixes:
```
Traceback (most recent call last):
File "/home/user/code/electrum-fork/electrum/plugins/psbt_nostr/qt.py", line 149, in on_receive
self.mark_pending_event_rcvd(event_id)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/home/user/code/electrum-fork/electrum/plugins/psbt_nostr/psbt_nostr.py", line 254, in mark_pending_event_rcvd
self.pending.set()
~~~~~~~~~~~~~~~~^^
File "/usr/lib64/python3.14/asyncio/locks.py", line 192, in set
fut.set_result(True)
~~~~~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.14/asyncio/base_events.py", line 829, in call_soon
self._check_thread()
~~~~~~~~~~~~~~~~~~^^
File "/usr/lib64/python3.14/asyncio/base_events.py", line 866, in _check_thread
raise RuntimeError(
"Non-thread-safe operation invoked on an event loop other "
"than the current one")
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
```
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a bug-fix patch for a crash in Electrum's optional PSBT-over-Nostr plugin. The plugin helps co-signers exchange partially-signed Bitcoin transactions. The crash happened because a background thread tried to update an asyncio synchronization object on the wrong event loop, triggering a RuntimeError. The fix routes that update to the correct asyncio loop. It is a reliability fix, not a security vulnerability, and there is no evidence it can be exploited by an attacker.

Recommended action

Treat as a normal stability bug fix. No urgent security action is required. Users of the psbt_nostr plugin should update to avoid crashes during co-signing workflows. Reviewers may want to audit other plugin callbacks for similar cross-thread asyncio access.

Security signals we found

01

Thread-safety violation in asyncio event-loop usage

02

Crash-only symptom (RuntimeError), no privilege escalation or data corruption evident

03

Fix uses existing utility run_sync_function_on_asyncio_thread for cross-thread scheduling

Risk score

Why this scored 17/100

Our methodology →
Potential impact 3/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.