From faeb40c5d1dbcb6548c9825b14fa3b72f6497d86 Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Sat, 8 Aug 2026 04:37:52 +0000 Subject: 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) --- src/main_gui.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/main_gui.cpp') 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[]) string rvRelay = argval2(argc, argv, "/rvrelay", "-rvrelay"); if (!rvRelay.empty()) { - vBtfMeetingRelays.clear(); - vBtfMeetingRelays.push_back(rvRelay); + if (!LooksLikeRelay(rvRelay)) + { + // A malformed pin must not replace the seed list: with the pin + // set, no discovered relay can ever mask the typo, and the pool + // would publish a garbage (or no) meeting node forever. + fprintf(stderr, "Ignoring /rvrelay=%s: expected host:port\n", + rvRelay.c_str()); + } + else + { + vBtfMeetingRelays.clear(); + vBtfMeetingRelays.push_back(rvRelay); + fBtfRelayPinned = true; + } } string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay"); -- cgit v1.2.3