mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-17 01:37:53 +00:00
Add tor-host option
This commit is contained in:
parent
e90430c99f
commit
214f33fd05
2 changed files with 9 additions and 3 deletions
|
@ -48,6 +48,9 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||||
QCommandLineOption useLocalTorOption(QStringList() << "use-local-tor", "Use system wide installed Tor instead of the bundled.");
|
QCommandLineOption useLocalTorOption(QStringList() << "use-local-tor", "Use system wide installed Tor instead of the bundled.");
|
||||||
parser.addOption(useLocalTorOption);
|
parser.addOption(useLocalTorOption);
|
||||||
|
|
||||||
|
QCommandLineOption torHostOption(QStringList() << "tor-host", "Address of running Tor instance.", "torHost");
|
||||||
|
parser.addOption(torHostOption);
|
||||||
|
|
||||||
QCommandLineOption torPortOption(QStringList() << "tor-port", "Port of running Tor instance.", "torPort");
|
QCommandLineOption torPortOption(QStringList() << "tor-port", "Port of running Tor instance.", "torPort");
|
||||||
parser.addOption(torPortOption);
|
parser.addOption(torPortOption);
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,14 @@ Tor::Tor(AppContext *ctx, QObject *parent)
|
||||||
this->torDir = Config::defaultConfigDir().filePath("tor");
|
this->torDir = Config::defaultConfigDir().filePath("tor");
|
||||||
this->torDataPath = QDir(this->torDir).filePath("data");
|
this->torDataPath = QDir(this->torDir).filePath("data");
|
||||||
|
|
||||||
if (m_ctx->cmdargs->isSet("tor-port")) {
|
if (m_ctx->cmdargs->isSet("tor-port") || m_ctx->cmdargs->isSet("tor-host")) {
|
||||||
|
if (m_ctx->cmdargs->isSet("tor-host"))
|
||||||
|
Tor::torHost = m_ctx->cmdargs->value("tor-host");
|
||||||
|
if (m_ctx->cmdargs->isSet("tor-port"))
|
||||||
Tor::torPort = m_ctx->cmdargs->value("tor-port").toUShort();
|
Tor::torPort = m_ctx->cmdargs->value("tor-port").toUShort();
|
||||||
this->localTor = true;
|
this->localTor = true;
|
||||||
if (!Utils::portOpen(Tor::torHost, Tor::torPort)) {
|
if (!Utils::portOpen(Tor::torHost, Tor::torPort)) {
|
||||||
this->errorMsg = QString("--tor-port was specified but no running Tor instance was found on port %1.").arg(QString::number(Tor::torPort));
|
this->errorMsg = QString("--tor-host || --tor-port were specified but no running Tor instance was found on %1:%2.").arg(Tor::torHost,QString::number(Tor::torPort));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue