Commit 0ef5ce6
fix(pow): filter wait_for_dm notifications so PoW detection actually fires
The concurrent PoW probe added in #173 spawned a fetch_required_pow_with
task whose kind-38385 events flow through the same global notification
broadcast wait_for_dm consumes (client.notifications() is global —
nostr-relay-pool::relay::inner::send_notification fans every event from
every subscription out to it). The notification loop returned the info
event as the "first event" and short-circuited the wait before mostrod
had a chance to (silently) drop the request, so the wait never timed
out, the PoW probe result was never consulted, and downstream
print_dm_events surfaced "No response received from Mostro" — exactly
the misleading UX the original fix was meant to eliminate.
Mirror the subscription filter inside the notification loop: only
accept Kind::GiftWrap events whose `p` tags include our trade key.
Everything else (kind-38385 info, unrelated gift wraps, status events)
is ignored, so the wait reaches its timeout cleanly and the existing
PowRequirementUnmet path fires as designed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 25e07ae commit 0ef5ce6
2 files changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
320 | 321 | | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
324 | | - | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
343 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
344 | 353 | | |
345 | 354 | | |
346 | 355 | | |
347 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
348 | 365 | | |
349 | 366 | | |
350 | 367 | | |
| |||
0 commit comments