Made CSuperblockManager::IsValidSuperblockHeight an inline function

This is for efficiency since this function is called often and is
only 1 line of code.
This commit is contained in:
Tim Flynn 2016-08-13 08:48:01 -04:00
parent c7f9e11575
commit 92adc98380
2 changed files with 11 additions and 13 deletions

View File

@ -218,18 +218,6 @@ std::vector<CSuperblock_sptr> CGovernanceTriggerManager::GetActiveTriggers()
DBG( cout << "GetActiveTriggers: vecResults.size() = " << vecResults.size() << endl; ); DBG( cout << "GetActiveTriggers: vecResults.size() = " << vecResults.size() << endl; );
return vecResults; return vecResults;
}
/**
* Is Valid Superblock Height
*
* - See if this block can be a superblock
*/
bool CSuperblockManager::IsValidSuperblockHeight(int nBlockHeight)
{
// SUPERBLOCKS CAN HAPPEN ONCE PER DAY
return nBlockHeight % Params().GetConsensus().nSuperblockCycle;
} }
/** /**

View File

@ -98,7 +98,17 @@ public:
return true; return true;
} }
static bool IsValidSuperblockHeight(int nBlockHeight); /**
* Is Valid Superblock Height
*
* - See if this block can be a superblock
*/
static bool IsValidSuperblockHeight(int nBlockHeight)
{
// SUPERBLOCKS CAN HAPPEN ONCE PER DAY
return nBlockHeight % Params().GetConsensus().nSuperblockCycle;
}
static bool IsSuperblockTriggered(int nBlockHeight); static bool IsSuperblockTriggered(int nBlockHeight);
static void CreateSuperblock(CMutableTransaction& txNew, CAmount nFees, int nBlockHeight); static void CreateSuperblock(CMutableTransaction& txNew, CAmount nFees, int nBlockHeight);