diff options
| author | Bitflash <btf01@proton.me> | 2026-07-29 11:51:37 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-29 11:51:37 -0300 |
| commit | 7f6fdbab6c90360ab3b2d391a7b5aedc6f9721ac (patch) | |
| tree | 4a5504cb39d72d15b85e1a05f2493f6fa04b2eb3 /src/btfaddr.cpp | |
| parent | ba2de82b76aeeabe1c45877e02b0e8fe5b59bed3 (diff) | |
nostr: never advertise a rendezvous we are not registered at (#26)
BtfActiveRelay() fell back to vBtfMeetingRelays[0] whenever registration had
not completed yet. ThreadNostrSeed and ThreadBtfAccept start in parallel
(net.cpp), so at boot that fallback was exactly what PublishDescriptor wrote
into the descriptor -- including the one-time self-test, which publishes to
every relay in the list. Peers reading it dialed a rendezvous this node was
never registered at, and whenever the first seed happened to be down
(92.246.128.180 was, for part of today) every one of those dials was wasted.
BtfActiveRelay() now returns only the relay ThreadBtfAccept confirmed, and
PublishDescriptor skips publishing until there is one. The seed loop
republishes on every pass, so the only cost is the delay until registration
succeeds; the self-test waits up to 60s for it so it still measures the
publish/resolve chain instead of losing the race against it.
Also fix the WebSocket handshake reader. On headers past the cap it did a
bare break, leaving the socket parked in the middle of the header block --
and since the status line had already been read, the " 101 " check still
passed, so the caller got a "connected" socket whose next bytes were
leftover HTTP that the frame parser then read as garbage frames. It now
errors out instead, and the cap is 8192 because relays behind Cloudflare
send large header blocks.
Diffstat (limited to 'src/btfaddr.cpp')
0 files changed, 0 insertions, 0 deletions