diff --git a/src/masternode.cpp b/src/masternode.cpp index c1b1bb404..859da5131 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -73,6 +73,7 @@ CMasternode::CMasternode() nScanningErrorCount = 0; nLastScanningErrorBlockHeight = 0; lastTimeChecked = 0; + nLastDsee = 0;// temporary, do not save. Remove after migration to v12 nLastDseep = 0;// temporary, do not save. Remove after migration to v12 } @@ -96,6 +97,7 @@ CMasternode::CMasternode(const CMasternode& other) nScanningErrorCount = other.nScanningErrorCount; nLastScanningErrorBlockHeight = other.nLastScanningErrorBlockHeight; lastTimeChecked = 0; + nLastDsee = other.nLastDsee;// temporary, do not save. Remove after migration to v12 nLastDseep = other.nLastDseep;// temporary, do not save. Remove after migration to v12 } @@ -119,6 +121,7 @@ CMasternode::CMasternode(const CMasternodeBroadcast& mnb) nScanningErrorCount = 0; nLastScanningErrorBlockHeight = 0; lastTimeChecked = 0; + nLastDsee = 0;// temporary, do not save. Remove after migration to v12 nLastDseep = 0;// temporary, do not save. Remove after migration to v12 } diff --git a/src/masternode.h b/src/masternode.h index 2751b86bc..0bdf39669 100644 --- a/src/masternode.h +++ b/src/masternode.h @@ -135,6 +135,7 @@ public: int nLastScanningErrorBlockHeight; CMasternodePing lastPing; + int64_t nLastDsee;// temporary, do not save. Remove after migration to v12 int64_t nLastDseep;// temporary, do not save. Remove after migration to v12 CMasternode(); diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 6343dd015..2f2d87374 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -860,9 +860,9 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // e.g. We don't want the entry relayed/time updated when we're syncing the list // mn.pubkey = pubkey, IsVinAssociatedWithPubkey is validated once below, // after that they just need to match - if(count == -1 && pmn->pubkey == pubkey && (GetAdjustedTime() - pmn->sigTime > MASTERNODE_MIN_MNB_SECONDS)){ + if(count == -1 && pmn->pubkey == pubkey && (GetAdjustedTime() - pmn->nLastDsee > MASTERNODE_MIN_MNB_SECONDS)){ if(pmn->protocolVersion > GETHEADERS_VERSION && sigTime - pmn->lastPing.sigTime < MASTERNODE_MIN_MNB_SECONDS) return; - if(pmn->sigTime < sigTime){ //take the newest entry + if(pmn->nLastDsee < sigTime){ //take the newest entry LogPrintf("dsee - Got updated entry for %s\n", addr.ToString().c_str()); if(pmn->protocolVersion < GETHEADERS_VERSION) { pmn->pubkey2 = pubkey2; @@ -873,6 +873,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData //fake ping pmn->lastPing = CMasternodePing(vin); } + pmn->nLastDsee = sigTime; pmn->Check(); if(pmn->IsEnabled()) { TRY_LOCK(cs_vNodes, lockNodes); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 1a9a3192f..a57ef7716 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -769,14 +769,18 @@ void BitcoinGUI::setNumBlocks(int count) ":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0'))) .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES; + progressBar->setMaximum(4 * MASTERNODE_SYNC_THRESHOLD); prevAttempt = masternodeSync.RequestedMasternodeAttempt + 1; prevAssets = masternodeSync.RequestedMasternodeAssets; if(prevAttempt <= MASTERNODE_SYNC_THRESHOLD) progress = prevAttempt + (prevAssets - 1) * MASTERNODE_SYNC_THRESHOLD; progressBar->setValue(progress); +#ifdef ENABLE_WALLET + if(walletFrame) + walletFrame->showOutOfSyncWarning(false); +#endif // ENABLE_WALLET } switch (masternodeSync.RequestedMasternodeAssets) { case MASTERNODE_SYNC_SPORKS: - progressBar->setMaximum(4 * MASTERNODE_SYNC_THRESHOLD); progressBarLabel->setText(tr("Synchronizing sporks...")); break; case MASTERNODE_SYNC_LIST: @@ -789,10 +793,6 @@ void BitcoinGUI::setNumBlocks(int count) progressBarLabel->setText(tr("Synchronizing budgets...")); break; case MASTERNODE_SYNC_FINISHED: -#ifdef ENABLE_WALLET - if(walletFrame) - walletFrame->showOutOfSyncWarning(false); -#endif // ENABLE_WALLET progressBarLabel->setVisible(false); progressBar->setVisible(false); labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));