doc, refactor: Changing -torcontrol help to specify that a default port is used

Right now when we get the help for -torcontrol it says that there is a
default ip and port we dont specify if there is a specified ip that we
would also use port 9051 as default
This commit is contained in:
kevkevin
2023-07-18 22:02:44 -05:00
parent 6ce5e8f475
commit 9a84200cfc
3 changed files with 5 additions and 4 deletions

View File

@@ -42,8 +42,8 @@
#include <event2/thread.h>
#include <event2/util.h>
/** Default control port */
const std::string DEFAULT_TOR_CONTROL = "127.0.0.1:9051";
/** Default control ip and port */
const std::string DEFAULT_TOR_CONTROL = "127.0.0.1:" + ToString(DEFAULT_TOR_CONTROL_PORT);
/** Tor cookie size (from control-spec.txt) */
static const int TOR_COOKIE_SIZE = 32;
/** Size of client/server nonce for SAFECOOKIE */
@@ -144,7 +144,7 @@ bool TorControlConnection::Connect(const std::string& tor_control_center, const
Disconnect();
}
const std::optional<CService> control_service{Lookup(tor_control_center, 9051, fNameLookup)};
const std::optional<CService> control_service{Lookup(tor_control_center, DEFAULT_TOR_CONTROL_PORT, fNameLookup)};
if (!control_service.has_value()) {
LogPrintf("tor: Failed to look up control center %s\n", tor_control_center);
return false;