From c86e68c785113928cdf9d8015868f936236e250a Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 11 Aug 2015 14:54:42 -0700 Subject: [PATCH] Move superblock check --- src/masternode-payments.cpp | 11 ++++++----- src/masternode-sync.cpp | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 1405004c8..7476d31d3 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -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; diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 7870de7fe..6c8f9abcb 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -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; }