Merge branch 'v0.12.0.x'

This commit is contained in:
Evan Duffield 2015-08-14 07:40:22 -07:00
commit 700bf2798f
4 changed files with 12 additions and 7 deletions

View File

@ -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
}

View File

@ -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();

View File

@ -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);

View File

@ -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));