Skip to content

Commit

Permalink
Merge pull request #5775
Browse files Browse the repository at this point in the history
deda3e1 [Qt] remove unused getNumBlocksAtStartup() from ClientModel (Philip Kaufmann)
47ee8cf [Qt] use qint64 in BitcoinGUI::setNumBlocks (Philip Kaufmann)
  • Loading branch information
laanwj committed Mar 3, 2015
2 parents f8e68f7 + deda3e1 commit 3dfcdf4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ void BitcoinGUI::setNumBlocks(int count)

QDateTime lastBlockDate = clientModel->getLastBlockDate();
QDateTime currentDate = QDateTime::currentDateTime();
int secs = lastBlockDate.secsTo(currentDate);
qint64 secs = lastBlockDate.secsTo(currentDate);

tooltip = tr("Processed %n blocks of transaction history.", "", count);

Expand Down Expand Up @@ -722,8 +722,8 @@ void BitcoinGUI::setNumBlocks(int count)
}
else
{
int years = secs / YEAR_IN_SECONDS;
int remainder = secs % YEAR_IN_SECONDS;
qint64 years = secs / YEAR_IN_SECONDS;
qint64 remainder = secs % YEAR_IN_SECONDS;
timeBehindText = tr("%1 and %2").arg(tr("%n year(s)", "", years)).arg(tr("%n week(s)","", remainder/WEEK_IN_SECONDS));
}

Expand Down
11 changes: 3 additions & 8 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
optionsModel(optionsModel),
peerTableModel(0),
cachedNumBlocks(0),
cachedReindexing(0), cachedImporting(0),
numBlocksAtStartup(-1), pollTimer(0)
cachedReindexing(0),
cachedImporting(0),
pollTimer(0)
{
peerTableModel = new PeerTableModel(this);
pollTimer = new QTimer(this);
Expand Down Expand Up @@ -65,12 +66,6 @@ int ClientModel::getNumBlocks() const
return chainActive.Height();
}

int ClientModel::getNumBlocksAtStartup()
{
if (numBlocksAtStartup == -1) numBlocksAtStartup = getNumBlocks();
return numBlocksAtStartup;
}

quint64 ClientModel::getTotalBytesRecv() const
{
return CNode::GetTotalBytesRecv();
Expand Down
3 changes: 0 additions & 3 deletions src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class ClientModel : public QObject
//! Return number of connections, default is in- and outbound (total)
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
int getNumBlocks() const;
int getNumBlocksAtStartup();

quint64 getTotalBytesRecv() const;
quint64 getTotalBytesSent() const;
Expand Down Expand Up @@ -77,8 +76,6 @@ class ClientModel : public QObject
bool cachedReindexing;
bool cachedImporting;

int numBlocksAtStartup;

QTimer *pollTimer;

void subscribeToCoreSignals();
Expand Down

0 comments on commit 3dfcdf4

Please sign in to comment.