mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-15 07:03:40 +01:00
Remove NumBlocksOfPeers
Generally useless information. Only updates on connect time, not after that. Peers can easily lie and the median filter is not effective in preventing that. In the past it was used for progress display in the GUI but `CheckPoints::guessVerificationProgress` provides a better way that is now used. It was too easy to mislead it. Peers do lie about it in practice, see issue #4065. From the RPC, `getpeerinfo` gives the peer raw values, which are more useful.
This commit is contained in:
@@ -403,8 +403,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
|
||||
setNumConnections(clientModel->getNumConnections());
|
||||
connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
|
||||
|
||||
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
|
||||
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
|
||||
setNumBlocks(clientModel->getNumBlocks());
|
||||
connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
|
||||
|
||||
// Receive and report messages from client model
|
||||
connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
|
||||
@@ -617,7 +617,7 @@ void BitcoinGUI::setNumConnections(int count)
|
||||
labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Bitcoin network", "", count));
|
||||
}
|
||||
|
||||
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
|
||||
void BitcoinGUI::setNumBlocks(int count)
|
||||
{
|
||||
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
|
||||
statusBar()->clearMessage();
|
||||
@@ -646,17 +646,10 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
|
||||
QDateTime currentDate = QDateTime::currentDateTime();
|
||||
int secs = lastBlockDate.secsTo(currentDate);
|
||||
|
||||
if(count < nTotalBlocks)
|
||||
{
|
||||
tooltip = tr("Processed %1 of %2 (estimated) blocks of transaction history.").arg(count).arg(nTotalBlocks);
|
||||
}
|
||||
else
|
||||
{
|
||||
tooltip = tr("Processed %1 blocks of transaction history.").arg(count);
|
||||
}
|
||||
tooltip = tr("Processed %1 blocks of transaction history.").arg(count);
|
||||
|
||||
// Set icon state: spinning if catching up, tick otherwise
|
||||
if(secs < 90*60 && count >= nTotalBlocks)
|
||||
if(secs < 90*60)
|
||||
{
|
||||
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
|
||||
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
||||
|
||||
Reference in New Issue
Block a user