Move superblock check

This commit is contained in:
Evan Duffield 2015-08-11 14:54:42 -07:00
parent 37efa72605
commit c86e68c785
2 changed files with 8 additions and 7 deletions

View File

@ -200,11 +200,6 @@ bool IsBlockValueValid(const CBlock& block, int64_t nExpectedValue){
LogPrintf("IsBlockValueValid() : WARNING: Couldn't find previous block");
}
//are these blocks even enabled
if(!IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS)){
return block.vtx[0].GetValueOut() <= nExpectedValue;
}
if(!masternodeSync.IsSynced()) { //there is no budget data to use to check anything
//super blocks will always be on these blocks, max 100 per budgeting
if(nHeight % GetBudgetPaymentCycleBlocks() < 100){
@ -213,6 +208,12 @@ bool IsBlockValueValid(const CBlock& block, int64_t nExpectedValue){
if(block.vtx[0].GetValueOut() > nExpectedValue) return false;
}
} else { // we're synced and have data so check the budget schedule
//are these blocks even enabled
if(!IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS)){
return block.vtx[0].GetValueOut() <= nExpectedValue;
}
if(budget.IsBudgetPaymentBlock(nHeight)){
//the value of the block is evaluated in CheckBlock
return true;

View File

@ -30,8 +30,8 @@ bool CMasternodeSync::IsBlockchainSynced()
static bool fBlockchainSynced = false;
static int64_t lastProcess = GetTime();
// if the last call to this function was more than 10 minutes ago (client was in sleep mode) reset the sync process
if(GetTime() - lastProcess > 60*10) {
// if the last call to this function was more than 60 minutes ago (client was in sleep mode) reset the sync process
if(GetTime() - lastProcess > 60*60) {
Reset();
fBlockchainSynced = false;
}