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:
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 842b0d5..63bdbb7 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -59,6 +59,9 @@ static void PrintUsage()
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("\n"); 61 printf("\n");
62 printf("Network:\n");
63 printf(" /port=N (P2P listen port, default 8433)\n");
64 printf("\n");
62 printf("Each option also accepts '-' instead of '/'.\n"); 65 printf("Each option also accepts '-' instead of '/'.\n");
63} 66}
64 67
@@ -113,6 +116,23 @@ static void ParseStartupArguments(int argc, char* argv[])
113 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay"); 116 string announceRelay = argval2(argc, argv, "/announcerelay", "-announcerelay");
114 if (!announceRelay.empty()) 117 if (!announceRelay.empty())
115 strBtfAnnounceRelay = announceRelay; 118 strBtfAnnounceRelay = announceRelay;
119
120 // net.cpp has described nListenPort as "tunable via /port" since it was
121 // written, but nothing ever read the option, so the port was fixed at 8433
122 // and a second node could not start on a machine already running one.
123 string strPort = argval2(argc, argv, "/port", "-port");
124 if (!strPort.empty())
125 {
126 int nPort = atoi(strPort.c_str());
127 if (nPort <= 0 || nPort > 65535)
128 fprintf(stderr, "Ignoring /port=%s: not a port number\n", strPort.c_str());
129 else
130 {
131 nListenPort = htons((unsigned short)nPort);
132 // Or we would announce a port we never bound.
133 addrLocalHost.port = nListenPort;
134 }
135 }
116} 136}
117 137
118int main(int argc, char* argv[]) 138int main(int argc, char* argv[])