mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-03 09:29:37 +00:00
Tor: temp port connection logging
This commit is contained in:
parent
844a7cc368
commit
fea15c2ff0
2 changed files with 6 additions and 1 deletions
|
@ -96,6 +96,7 @@ void TorManager::start() {
|
|||
}
|
||||
|
||||
void TorManager::checkConnection() {
|
||||
qDebug() << "Checking Tor connection";
|
||||
// We might not be able to connect to localhost if torsocks is used to start feather
|
||||
if (Utils::isTorsocks()) {
|
||||
this->setConnectionState(true);
|
||||
|
@ -117,6 +118,7 @@ void TorManager::checkConnection() {
|
|||
}
|
||||
|
||||
else if (m_localTor) {
|
||||
qDebug() << "Tor daemon is local";
|
||||
QString host = config()->get(Config::socks5Host).toString();
|
||||
quint16 port = config()->get(Config::socks5Port).toString().toUShort();
|
||||
this->setConnectionState(Utils::portOpen(host, port));
|
||||
|
|
|
@ -295,10 +295,13 @@ bool portOpen(const QString &hostname, quint16 port) { // TODO: this call should
|
|||
if (config()->get(Config::offlineMode).toBool()) {
|
||||
return false;
|
||||
}
|
||||
qDebug() << QString("Checking for open port on: %1:%2").arg(hostname, QString::number(port));
|
||||
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(hostname, port);
|
||||
return socket.waitForConnected(600);
|
||||
bool res = socket.waitForConnected(600);
|
||||
qDebug() << QString("Port " + (res ? QString("Open") : QString("Closed")));
|
||||
return res;
|
||||
}
|
||||
|
||||
quint16 getDefaultRpcPort(NetworkType::Type type) {
|
||||
|
|
Loading…
Reference in a new issue