upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/nostr.h
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-08-08 04:37:52 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-08-19 22:48:26 +0000
commitfaeb40c5d1dbcb6548c9825b14fa3b72f6497d86 (patch)
treeb300375a478c801c40ef73bbe3c47a61e77553a9 /src/nostr.h
parent541223daa6e6510daf3bdfdcb4dd4f6b0e38d877 (diff)
nostr: make /rvrelay a true pin -- never merge discovered relays
A pool started with /rvrelay=ONE still spawned an accept thread for every Nostr-discovered relay (BtfAllRelays always merged g_discoveredRelays), and each thread optimistically overwrote the advertised meeting node before registering -- so a discovered Tailscale-only relay (a mesh host) flapped the published .btf descriptor and public miners could not connect. fBtfRelayPinned (set only when /rvrelay parses) makes BtfAllRelays return exactly the pinned list. Also validate the /rvrelay value at parse time: with the pin in place no discovered relay can mask a typo. (cherry picked from commit 0a4d2b02fa5382c5e788b5f0e2f8a844695dec47)
Diffstat (limited to 'src/nostr.h')
-rw-r--r--src/nostr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nostr.h b/src/nostr.h
index b5eb5e3..827b2f3 100644
--- a/src/nostr.h
+++ b/src/nostr.h
@@ -43,6 +43,14 @@ void BtfSetActiveRelay(const std::string& relay);
43// If set (via /announcerelay=host:port), this node announces that relay on 43// If set (via /announcerelay=host:port), this node announces that relay on
44// Nostr so other nodes discover it automatically -- no manual seed-list edit. 44// Nostr so other nodes discover it automatically -- no manual seed-list edit.
45extern std::string strBtfAnnounceRelay; 45extern std::string strBtfAnnounceRelay;
46// True when /rvrelay pinned the meeting relay list: BtfAllRelays then returns
47// ONLY vBtfMeetingRelays, never Nostr-discovered volunteer relays. Without
48// this, a pool that pins one public relay still spawns an accept thread per
49// discovered relay, and each thread's optimistic BtfSetActiveRelay makes the
50// published descriptor flap to relays the pool may not be reachable at.
51extern bool fBtfRelayPinned;
52// Basic sanity check on a "host:port" relay address (numeric port 1..65535).
53bool LooksLikeRelay(const std::string& r);
46// Every relay to try: curated seeds + relays discovered from Nostr announcements. 54// Every relay to try: curated seeds + relays discovered from Nostr announcements.
47std::vector<std::string> BtfAllRelays(); 55std::vector<std::string> BtfAllRelays();
48 56