upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
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/main_gui.cpp
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/main_gui.cpp')
-rw-r--r--src/main_gui.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 0b4e091..d0969b5 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -261,8 +261,20 @@ static void ParseStartupArguments(int argc, char* argv[])
261 string rvRelay = argval2(argc, argv, "/rvrelay", "-rvrelay"); 261 string rvRelay = argval2(argc, argv, "/rvrelay", "-rvrelay");
262 if (!rvRelay.empty()) 262 if (!rvRelay.empty())
263 { 263 {
264 vBtfMeetingRelays.clear(); 264 if (!LooksLikeRelay(rvRelay))
265 vBtfMeetingRelays.push_back(rvRelay); 265 {
266 // A malformed pin must not replace the seed list: with the pin
267 // set, no discovered relay can ever mask the typo, and the pool
268 // would publish a garbage (or no) meeting node forever.
269 fprintf(stderr, "Ignoring /rvrelay=%s: expected host:port\n",
270 rvRelay.c_str());
271 }
272 else
273 {
274 vBtfMeetingRelays.clear();
275 vBtfMeetingRelays.push_back(rvRelay);
276 fBtfRelayPinned = true;
277 }
266 } 278 }
267 279
268 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay"); 280 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay");