if there is no current block number available display N/A on totalBlocks label, instead of 0, which can not ever be true

This commit is contained in:
Philip Kaufmann 2012-05-11 12:29:31 +02:00
parent a8fef7f569
commit 66331f2b51

View file

@ -232,7 +232,8 @@ void RPCConsole::setNumBlocks(int count)
ui->numberOfBlocks->setText(QString::number(count));
if(clientModel)
{
ui->totalBlocks->setText(QString::number(clientModel->getNumBlocksOfPeers()));
// If there is no current number available display N/A instead of 0, which can't ever be true
ui->totalBlocks->setText(clientModel->getNumBlocksOfPeers() == 0 ? tr("N/A") : QString::number(clientModel->getNumBlocksOfPeers()));
ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString());
}
}