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 <btf01@proton.me>2026-07-29 12:05:12 -0300
committerGitHub <noreply@github.com>2026-07-29 12:05:12 -0300
commit137a166fe0b95ccdef444041e907358bd26bc226 (patch)
treebab295f18576f5d139bd7746f3c141fbbdfea3e2 /src/main_gui.cpp
parent96a8e42bbc313f96d54377ae5886da84298e61a3 (diff)
Remove peer exchange from main; it was merged unreviewed (#27)
PR #25 was opened, reviewed and approved as a single-file change to net.cpp: the .btf peer cache, +169/-0. I then pushed peer exchange and a /port option onto that same branch while the PR was open, which silently widened it to six files. The merge carried all of it in. Nothing about the peer exchange had been validated. Its two-node test never completed -- node B could not dial node A at all -- so what landed on main is unproven network protocol code that no one agreed to take. This restores main to what #25 actually described. The peer cache stays, with its runtime numbers (36.3s to 2.1s to first peer). #26 stays. What comes out: - the "btfpeers" message, both directions - BtfPexCollect / BtfPexAccept and the per-message caps - CNode::nLastPexRecv - the `desc` field on the cached peer record - BtfLocalDescriptor / BtfSecpContext - /port Peer exchange returns as its own pull request once its test passes. The /port option is worth having on its own -- two nodes cannot share a machine without it, which is what blocked the test -- and should go up separately rather than ride along again. Release v1.2.2 is unaffected: it was built from ba2de82, before either merge.
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index edc772d..842b0d5 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -58,7 +58,6 @@ static void PrintUsage()
58 printf(" /connectbtf=PEER_BTF_ADDRESS\n"); 58 printf(" /connectbtf=PEER_BTF_ADDRESS\n");
59 printf(" /rvrelay=HOST:PORT\n"); 59 printf(" /rvrelay=HOST:PORT\n");
60 printf(" /announcerelay=HOST:PORT\n"); 60 printf(" /announcerelay=HOST:PORT\n");
61 printf(" /port=N (P2P listen port, default 8433)\n");
62 printf("\n"); 61 printf("\n");
63 printf("Each option also accepts '-' instead of '/'.\n"); 62 printf("Each option also accepts '-' instead of '/'.\n");
64} 63}
@@ -114,23 +113,6 @@ static void ParseStartupArguments(int argc, char* argv[])
114 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay"); 113 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay");
115 if (!announceRelay.empty()) 114 if (!announceRelay.empty())
116 strBtfAnnounceRelay = announceRelay; 115 strBtfAnnounceRelay = announceRelay;
117
118 // net.cpp has claimed nListenPort was "tunable via /port" since it was
119 // written, but nothing ever read the option. Without it a second node
120 // cannot start on a machine that already runs one -- which is exactly what
121 // testing peer exchange needs.
122 string strPort = argval2(argc, argv, "/port", "-port");
123 if (!strPort.empty())
124 {
125 int nPort = atoi(strPort.c_str());
126 if (nPort <= 0 || nPort > 65535)
127 fprintf(stderr, "Ignoring /port=%s: not a port number\n", strPort.c_str());
128 else
129 {
130 nListenPort = htons((unsigned short)nPort);
131 addrLocalHost.port = nListenPort; // or we advertise a port we never bound
132 }
133 }
134} 116}
135 117
136int main(int argc, char* argv[]) 118int main(int argc, char* argv[])