Browse Source

Render things unconditionally on hushd tab

turkish
Jonathan "Duke" Leto 5 years ago
parent
commit
2e9ecbc308
  1. 21
      src/mainwindow.ui
  2. 52
      src/rpc.cpp

21
src/mainwindow.ui

@ -936,6 +936,27 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="notarizedhashlabel">
<property name="text">
<string>Notarized Hash</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="notarizedhashvalue">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="notarizedhashspacer">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="solrate">
<property name="text">

52
src/rpc.cpp

@ -576,23 +576,21 @@ void RPC::getInfoThenRefresh(bool force) {
}
// Get network sol/s
if (ezcashd) {
json payload = {
{"jsonrpc", "1.0"},
{"id", "someid"},
{"method", "getnetworksolps"}
};
json payload = {
{"jsonrpc", "1.0"},
{"id", "someid"},
{"method", "getnetworksolps"}
};
conn->doRPCIgnoreError(payload, [=](const json& reply) {
qint64 solrate = reply.get<json::number_unsigned_t>();
conn->doRPCIgnoreError(payload, [=](const json& reply) {
qint64 solrate = reply.get<json::number_unsigned_t>();
ui->numconnections->setText(QString::number(connections));
ui->solrate->setText(QString::number(solrate) % " Sol/s");
});
}
ui->numconnections->setText(QString::number(connections));
ui->solrate->setText(QString::number(solrate) % " Sol/s");
});
// Call to see if the blockchain is syncing.
json payload = {
payload = {
{"jsonrpc", "1.0"},
{"id", "someid"},
{"method", "getblockchaininfo"}
@ -612,22 +610,20 @@ void RPC::getInfoThenRefresh(bool force) {
Settings::getInstance()->setBlockNumber(blockNumber);
// Update zcashd tab if it exists
if (ezcashd) {
if (isSyncing) {
QString txt = QString::number(blockNumber);
if (estimatedheight > 0) {
txt = txt % " / ~" % QString::number(estimatedheight);
// If estimated height is available, then use the download blocks
// as the progress instead of verification progress.
progress = (double)blockNumber / (double)estimatedheight;
}
txt = txt % " ( " % QString::number(progress * 100, 'f', 2) % "% )";
ui->blockheight->setText(txt);
ui->heightLabel->setText(QObject::tr("Downloading blocks"));
} else {
ui->blockheight->setText(QString::number(blockNumber));
ui->heightLabel->setText(QObject::tr("Block height"));
if (isSyncing) {
QString txt = QString::number(blockNumber);
if (estimatedheight > 0) {
txt = txt % " / ~" % QString::number(estimatedheight);
// If estimated height is available, then use the download blocks
// as the progress instead of verification progress.
progress = (double)blockNumber / (double)estimatedheight;
}
txt = txt % " ( " % QString::number(progress * 100, 'f', 2) % "% )";
ui->blockheight->setText(txt);
ui->heightLabel->setText(QObject::tr("Downloading blocks"));
} else {
ui->blockheight->setText(QString::number(blockNumber));
ui->heightLabel->setText(QObject::tr("Block height"));
}
// Update the status bar

Loading…
Cancel
Save