mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-21 09:08:41 +02:00
Misc networking fixes
- connecting to nodes is much faster and more reliable now - reduced the amount of spaghetti in libwalletqt and greatly simplified the logic in nodes.cpp - Settings -> Node dialog should feel slightly more responsive - during synchronization the status bar will now display the amount of data downloaded - fixed some edge cases that could cause unreasonably long hangs - Help -> Debug Info screen now auto-updates every 5 seconds - Don't use SSL over Tor
This commit is contained in:
@@ -12,15 +12,26 @@
|
||||
DebugInfoDialog::DebugInfoDialog(AppContext *ctx, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::DebugInfoDialog)
|
||||
, m_ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->btn_Copy, &QPushButton::clicked, this, &DebugInfoDialog::copyToClipboad);
|
||||
|
||||
m_updateTimer.start(5000);
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &DebugInfoDialog::updateInfo);
|
||||
this->updateInfo();
|
||||
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
void DebugInfoDialog::updateInfo() {
|
||||
QString torStatus;
|
||||
if(ctx->isTorSocks)
|
||||
if(m_ctx->isTorSocks)
|
||||
torStatus = "Torsocks";
|
||||
else if(ctx->tor->localTor)
|
||||
else if(m_ctx->tor->localTor)
|
||||
torStatus = "Local (assumed to be running)";
|
||||
else if(ctx->tor->torConnected)
|
||||
else if(m_ctx->tor->torConnected)
|
||||
torStatus = "Running";
|
||||
else
|
||||
torStatus = "Unknown";
|
||||
@@ -28,32 +39,28 @@ DebugInfoDialog::DebugInfoDialog(AppContext *ctx, QWidget *parent)
|
||||
ui->label_featherVersion->setText(QString("%1-%2").arg(FEATHER_VERSION, FEATHER_BRANCH));
|
||||
ui->label_moneroVersion->setText(QString("%1-%2").arg(MONERO_VERSION, MONERO_BRANCH));
|
||||
|
||||
ui->label_walletHeight->setText(QString::number(ctx->currentWallet->blockChainHeight()));
|
||||
ui->label_daemonHeight->setText(QString::number(ctx->currentWallet->daemonBlockChainHeight()));
|
||||
ui->label_targetHeight->setText(QString::number(ctx->currentWallet->daemonBlockChainTargetHeight()));
|
||||
ui->label_restoreHeight->setText(QString::number(ctx->currentWallet->getWalletCreationHeight()));
|
||||
ui->label_synchronized->setText(ctx->currentWallet->synchronized() ? "True" : "False");
|
||||
ui->label_walletHeight->setText(QString::number(m_ctx->currentWallet->blockChainHeight()));
|
||||
ui->label_daemonHeight->setText(QString::number(m_ctx->currentWallet->daemonBlockChainHeight()));
|
||||
ui->label_targetHeight->setText(QString::number(m_ctx->currentWallet->daemonBlockChainTargetHeight()));
|
||||
ui->label_restoreHeight->setText(QString::number(m_ctx->currentWallet->getWalletCreationHeight()));
|
||||
ui->label_synchronized->setText(m_ctx->currentWallet->synchronized() ? "True" : "False");
|
||||
|
||||
auto node = ctx->nodes->connection();
|
||||
auto node = m_ctx->nodes->connection();
|
||||
ui->label_remoteNode->setText(node.full);
|
||||
ui->label_walletStatus->setText(this->statusToString(ctx->currentWallet->connected()));
|
||||
ui->label_walletStatus->setText(this->statusToString(m_ctx->currentWallet->connectionStatus()));
|
||||
ui->label_torStatus->setText(torStatus);
|
||||
ui->label_websocketStatus->setText(Utils::QtEnumToString(ctx->ws->webSocket.state()));
|
||||
ui->label_websocketStatus->setText(Utils::QtEnumToString(m_ctx->ws->webSocket.state()));
|
||||
|
||||
ui->label_netType->setText(Utils::QtEnumToString(ctx->currentWallet->nettype()));
|
||||
ui->label_seedType->setText(ctx->currentWallet->getCacheAttribute("feather.seed").isEmpty() ? "25 word" : "14 word");
|
||||
ui->label_viewOnly->setText(ctx->currentWallet->viewOnly() ? "True" : "False");
|
||||
ui->label_netType->setText(Utils::QtEnumToString(m_ctx->currentWallet->nettype()));
|
||||
ui->label_seedType->setText(m_ctx->currentWallet->getCacheAttribute("feather.seed").isEmpty() ? "25 word" : "14 word");
|
||||
ui->label_viewOnly->setText(m_ctx->currentWallet->viewOnly() ? "True" : "False");
|
||||
|
||||
QString os = QSysInfo::prettyProductName();
|
||||
if (ctx->isTails) {
|
||||
if (m_ctx->isTails) {
|
||||
os = QString("Tails %1").arg(TailsOS::version());
|
||||
}
|
||||
ui->label_OS->setText(os);
|
||||
ui->label_timestamp->setText(QString::number(QDateTime::currentSecsSinceEpoch()));
|
||||
|
||||
connect(ui->btn_Copy, &QPushButton::clicked, this, &DebugInfoDialog::copyToClipboad);
|
||||
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
QString DebugInfoDialog::statusToString(Wallet::ConnectionStatus status) {
|
||||
@@ -72,27 +79,28 @@ QString DebugInfoDialog::statusToString(Wallet::ConnectionStatus status) {
|
||||
}
|
||||
|
||||
void DebugInfoDialog::copyToClipboad() {
|
||||
// Two spaces at the end of each line are for newlines in Markdown
|
||||
QString text = "";
|
||||
text += QString("Feather version: %1\n").arg(ui->label_featherVersion->text());
|
||||
text += QString("Monero version: %1\n").arg(ui->label_moneroVersion->text());
|
||||
text += QString("Feather version: %1 \n").arg(ui->label_featherVersion->text());
|
||||
text += QString("Monero version: %1 \n").arg(ui->label_moneroVersion->text());
|
||||
|
||||
text += QString("Wallet height: %1\n").arg(ui->label_walletHeight->text());
|
||||
text += QString("Daemon height: %1\n").arg(ui->label_daemonHeight->text());
|
||||
text += QString("Target height: %1\n").arg(ui->label_targetHeight->text());
|
||||
text += QString("Restore height: %1\n").arg(ui->label_restoreHeight->text());
|
||||
text += QString("Synchronized: %1\n").arg(ui->label_synchronized->text());
|
||||
text += QString("Wallet height: %1 \n").arg(ui->label_walletHeight->text());
|
||||
text += QString("Daemon height: %1 \n").arg(ui->label_daemonHeight->text());
|
||||
text += QString("Target height: %1 \n").arg(ui->label_targetHeight->text());
|
||||
text += QString("Restore height: %1 \n").arg(ui->label_restoreHeight->text());
|
||||
text += QString("Synchronized: %1 \n").arg(ui->label_synchronized->text());
|
||||
|
||||
text += QString("Remote node: %1\n").arg(ui->label_remoteNode->text());
|
||||
text += QString("Wallet status: %1\n").arg(ui->label_walletStatus->text());
|
||||
text += QString("Tor status: %1\n").arg(ui->label_torStatus->text());
|
||||
text += QString("Websocket status: %1\n").arg(ui->label_websocketStatus->text());
|
||||
text += QString("Remote node: %1 \n").arg(ui->label_remoteNode->text());
|
||||
text += QString("Wallet status: %1 \n").arg(ui->label_walletStatus->text());
|
||||
text += QString("Tor status: %1 \n").arg(ui->label_torStatus->text());
|
||||
text += QString("Websocket status: %1 \n").arg(ui->label_websocketStatus->text());
|
||||
|
||||
text += QString("Network type: %1\n").arg(ui->label_netType->text());
|
||||
text += QString("Seed type: %1\n").arg(ui->label_seedType->text());
|
||||
text += QString("View only: %1\n").arg(ui->label_viewOnly->text());
|
||||
text += QString("Network type: %1 \n").arg(ui->label_netType->text());
|
||||
text += QString("Seed type: %1 \n").arg(ui->label_seedType->text());
|
||||
text += QString("View only: %1 \n").arg(ui->label_viewOnly->text());
|
||||
|
||||
text += QString("Operating system: %1\n").arg(ui->label_OS->text());
|
||||
text += QString("Timestamp: %1\n").arg(ui->label_timestamp->text());
|
||||
text += QString("Operating system: %1 \n").arg(ui->label_OS->text());
|
||||
text += QString("Timestamp: %1 \n").arg(ui->label_timestamp->text());
|
||||
|
||||
Utils::copyToClipboard(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user