X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=008f209ad2f45dd89e9eb1aaee755b692cd89922;hp=473e5bf4f33d1495c484476abda73240f44c1ce0;hb=90852995d1c9872f87c9a155c5f6d01fd1a35934;hpb=50c7b7bccd85b440caec734cc2cca4a40fa8496b diff --git a/src/main.cpp b/src/main.cpp index 473e5bf..008f209 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1263,13 +1263,14 @@ bool IsInitialBlockDownload() return true; static int64_t nLastUpdate; static CBlockIndex* pindexLastBest; + int64_t nCurrentTime = GetTime(); if (pindexBest != pindexLastBest) { pindexLastBest = pindexBest; - nLastUpdate = GetTime(); + nLastUpdate = nCurrentTime; } - return (GetTime() - nLastUpdate < 10 && - pindexBest->GetBlockTime() < GetTime() - 24 * 60 * 60); + return (nCurrentTime - nLastUpdate < 10 && + pindexBest->GetBlockTime() < nCurrentTime - 24 * 60 * 60); } void static InvalidChainFound(CBlockIndex* pindexNew) @@ -2213,7 +2214,9 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos) hashPrevBestCoinBase = vtx[0].GetHash(); } - uiInterface.NotifyBlocksChanged(); + static int8_t counter = 0; + if( (++counter & 0x0F) == 0 || !IsInitialBlockDownload()) // repaint every 16 blocks if not in initial block download + uiInterface.NotifyBlocksChanged(); return true; }