mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Code review results changes
This commit is contained in:
parent
e1b7b15cca
commit
ee85293d27
@ -623,18 +623,6 @@ UniValue voteraw(const UniValue& params, bool fHelp)
|
||||
|
||||
UniValue getgovernanceinfo(const UniValue& params, bool fHelp)
|
||||
{
|
||||
int nLastSuperblock, nNextSuperblock;
|
||||
|
||||
// Get current block height
|
||||
int nBlockHeight = (int)chainActive.Height();
|
||||
|
||||
// Get chain parameters
|
||||
int nSuperblockStartBlock = Params().GetConsensus().nSuperblockStartBlock;
|
||||
int nSuperblockCycle = Params().GetConsensus().nSuperblockCycle;
|
||||
|
||||
// Get first superblock
|
||||
int nFirstSuperblock = nSuperblockStartBlock - (nSuperblockStartBlock % nSuperblockCycle) + nSuperblockCycle;
|
||||
|
||||
if (fHelp || params.size() != 0) {
|
||||
throw runtime_error(
|
||||
"getgovernanceinfo\n"
|
||||
@ -653,6 +641,20 @@ UniValue getgovernanceinfo(const UniValue& params, bool fHelp)
|
||||
);
|
||||
}
|
||||
|
||||
// Compute last/next superblock
|
||||
int nLastSuperblock, nNextSuperblock;
|
||||
|
||||
// Get current block height
|
||||
int nBlockHeight = (int)chainActive.Height();
|
||||
|
||||
// Get chain parameters
|
||||
int nSuperblockStartBlock = Params().GetConsensus().nSuperblockStartBlock;
|
||||
int nSuperblockCycle = Params().GetConsensus().nSuperblockCycle;
|
||||
|
||||
// Get first superblock
|
||||
int nFirstSuperblockOffset = (nSuperblockCycle - nSuperblockStartBlock % nSuperblockCycle) % nSuperblockCycle;
|
||||
int nFirstSuperblock = nSuperblockStartBlock + nFirstSuperblockOffset;
|
||||
|
||||
if(nBlockHeight < nFirstSuperblock){
|
||||
nLastSuperblock = 0;
|
||||
nNextSuperblock = nFirstSuperblock;
|
||||
|
Loading…
Reference in New Issue
Block a user