mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-02 11:55:42 +02:00
gui: show maximum mempool size in information window
This commit is contained in:
@@ -1000,15 +1000,16 @@ void RPCConsole::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
||||
}
|
||||
}
|
||||
|
||||
void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage)
|
||||
void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage, size_t maxUsage)
|
||||
{
|
||||
ui->mempoolNumberTxs->setText(QString::number(numberOfTxs));
|
||||
|
||||
if (dynUsage < 1000000) {
|
||||
ui->mempoolSize->setText(QObject::tr("%1 kB").arg(dynUsage / 1000.0, 0, 'f', 2));
|
||||
} else {
|
||||
ui->mempoolSize->setText(QObject::tr("%1 MB").arg(dynUsage / 1000000.0, 0, 'f', 2));
|
||||
}
|
||||
const auto cur_usage_str = dynUsage < 1000000 ?
|
||||
QObject::tr("%1 kB").arg(dynUsage / 1000.0, 0, 'f', 2) :
|
||||
QObject::tr("%1 MB").arg(dynUsage / 1000000.0, 0, 'f', 2);
|
||||
const auto max_usage_str = QObject::tr("%1 MB").arg(maxUsage / 1000000.0, 0, 'f', 2);
|
||||
|
||||
ui->mempoolSize->setText(cur_usage_str + " / " + max_usage_str);
|
||||
}
|
||||
|
||||
void RPCConsole::on_lineEdit_returnPressed()
|
||||
@@ -1400,4 +1401,4 @@ void RPCConsole::updateWindowTitle()
|
||||
const QString chainType = QString::fromStdString(Params().GetChainTypeString());
|
||||
const QString title = tr("Node window - [%1]").arg(chainType);
|
||||
this->setWindowTitle(title);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user