Refactor/encapsulate chain globals into a CChain class
This commit is contained in:
@@ -42,7 +42,7 @@ int ClientModel::getNumConnections() const
|
||||
|
||||
int ClientModel::getNumBlocks() const
|
||||
{
|
||||
return nBestHeight;
|
||||
return chainActive.Height();
|
||||
}
|
||||
|
||||
int ClientModel::getNumBlocksAtStartup()
|
||||
@@ -53,8 +53,8 @@ int ClientModel::getNumBlocksAtStartup()
|
||||
|
||||
QDateTime ClientModel::getLastBlockDate() const
|
||||
{
|
||||
if (pindexBest)
|
||||
return QDateTime::fromTime_t(pindexBest->GetBlockTime());
|
||||
if (chainActive.Tip())
|
||||
return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime());
|
||||
else if(!isTestNet())
|
||||
return QDateTime::fromTime_t(1231006505); // Genesis block's time
|
||||
else
|
||||
@@ -63,7 +63,7 @@ QDateTime ClientModel::getLastBlockDate() const
|
||||
|
||||
double ClientModel::getVerificationProgress() const
|
||||
{
|
||||
return Checkpoints::GuessVerificationProgress(pindexBest);
|
||||
return Checkpoints::GuessVerificationProgress(chainActive.Tip());
|
||||
}
|
||||
|
||||
void ClientModel::updateTimer()
|
||||
|
||||
Reference in New Issue
Block a user