[Qt] only update "amount of blocks left" when the header chain is in-sync

This commit is contained in:
Jonas Schnelli 2016-09-13 16:36:24 +02:00
parent e3245b43d5
commit d8b062ef5e
No known key found for this signature in database
GPG key ID: 29D4BCB6416F53EC
6 changed files with 32 additions and 9 deletions

View file

@ -68,7 +68,7 @@ int ClientModel::getNumBlocks() const
return chainActive.Height();
}
int ClientModel::getHeaderHeight() const
int ClientModel::getHeaderTipHeight() const
{
LOCK(cs_main);
if (!pindexBestHeader)
@ -76,6 +76,14 @@ int ClientModel::getHeaderHeight() const
return pindexBestHeader->nHeight;
}
int64_t ClientModel::getHeaderTipTime() const
{
LOCK(cs_main);
if (!pindexBestHeader)
return 0;
return pindexBestHeader->GetBlockTime();
}
quint64 ClientModel::getTotalBytesRecv() const
{
return CNode::GetTotalBytesRecv();