upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/git/authorization.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-10 00:11:20 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-10 00:11:20 +0000
commitced6ef15a1e2ff4babd8a291f6d423846d986302 (patch)
treea51554146164490213c5c241fd2f2ab4ba797ef4 /src/git/authorization.rs
parentbbdc68cd9a04cdabfa4a1fffd507048f555d5fa5 (diff)
fix: detect NIP-77 NOTICE immediately during negentropy sync
Previously, when a relay didn't support NIP-77, the negentropy_sync_diff function would wait for the full client.sync() timeout even after receiving a NOTICE message that marked the relay as not supporting NIP-77. This change uses tokio::select! to race the sync operation against a polling task that checks the nip77_supported flag every 10ms. When a NOTICE is received (detected in the message handler), the poll task detects the status change and immediately returns an error, allowing quick fallback to REQ+EOSE without waiting for timeouts. Benefits: - Fast failure (within 10ms) when relay sends NIP-77 NOTICE - No artificial timeout reduction that could hurt legitimate operations - Maintains full timeout for relays that actually support NIP-77
Diffstat (limited to 'src/git/authorization.rs')
0 files changed, 0 insertions, 0 deletions