File tree Expand file tree Collapse file tree 3 files changed +8
-21
lines changed
Expand file tree Collapse file tree 3 files changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ int64_t ClientModel::getLastBlockProcessedTime() const
150150 return cacheTip == nullptr ? Params ().GenesisBlock ().GetBlockTime () : cacheTip->GetBlockTime ();
151151}
152152
153+ bool ClientModel::isTipCached () const
154+ {
155+ return cacheTip;
156+ }
157+
153158double ClientModel::getVerificationProgress () const
154159{
155160 return Checkpoints::GuessVerificationProgress (cacheTip);
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class ClientModel : public QObject
6868 int getLastBlockProcessedHeight () const ;
6969 int64_t getLastBlockProcessedTime () const ;
7070 double getVerificationProgress () const ;
71+ bool isTipCached () const ;
7172
7273 quint64 getTotalBytesRecv () const ;
7374 quint64 getTotalBytesSent () const ;
Original file line number Diff line number Diff line change @@ -474,26 +474,7 @@ void TopBar::setNumBlocks(int count)
474474 if (!clientModel)
475475 return ;
476476
477- // Acquire current block source
478- enum BlockSource blockSource = clientModel->getBlockSource ();
479- std::string text = " " ;
480- switch (blockSource) {
481- case BLOCK_SOURCE_NETWORK:
482- text = " Synchronizing.." ;
483- break ;
484- case BLOCK_SOURCE_DISK:
485- text = " Importing blocks from disk.." ;
486- break ;
487- case BLOCK_SOURCE_REINDEX:
488- text = " Reindexing blocks on disk.." ;
489- break ;
490- case BLOCK_SOURCE_NONE:
491- // Case: not Importing, not Reindexing and no network connection
492- text = " No block source available.." ;
493- ui->pushButtonSync ->setChecked (false );
494- break ;
495- }
496-
477+ std::string text;
497478 bool needState = true ;
498479 if (masternodeSync.IsBlockchainSynced ()) {
499480 // chain synced
@@ -523,7 +504,7 @@ void TopBar::setNumBlocks(int count)
523504 Q_EMIT walletSynced (false );
524505 }
525506
526- if (needState) {
507+ if (needState && clientModel-> isTipCached () ) {
527508 // Represent time from last generated block in human readable text
528509 QDateTime lastBlockDate = clientModel->getLastBlockDate ();
529510 QDateTime currentDate = QDateTime::currentDateTime ();
You can’t perform that action at this time.
0 commit comments