Skip to content

Commit

Permalink
Remove warning during compilation, fixed ioncoincore#9
Browse files Browse the repository at this point in the history
  • Loading branch information
cevap committed Feb 6, 2021
1 parent 89957fe commit 722bdeb
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3063,10 +3063,23 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
/** cevap: Ion accepts PoS during PoW phase, PoW Ends with block 1000, PoS starts with 455, testnet 74
*
*/
if (pindex->nHeight <= 73 && block.IsProofOfStake() && Params().NetworkID() == CBaseChainParams::TESTNET || pindex->nHeight <= 454 && block.IsProofOfStake())
return state.DoS(100, error("ConnectBlock() : PoS period not active"),
REJECT_INVALID, "PoS-early");

/** cevap: Ion accepts PoS during PoW phase, PoW Ends with block 1000, PoS starts with 455, testnet 74
*
*/
/** cevap: fix "warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]"
* Orig: if (pindex->nHeight <= 73 && block.IsProofOfStake() && Params().NetworkID() == CBaseChainParams::TESTNET || pindex->nHeight <= 454 && block.IsProofOfStake())
*/
if (block.IsProofOfStake()) {

if (pindex->nHeight <= 73 && Params().NetworkID() == CBaseChainParams::TESTNET)
return state.DoS(100, error("ConnectBlock() : PoS period not active"),
REJECT_INVALID, "PoS-early");

if (pindex->nHeight <= 454)
return state.DoS(100, error("ConnectBlock() : PoS period not active"),
REJECT_INVALID, "PoS-early");
}

if (pindex->nHeight > Params().LAST_POW_BLOCK() && block.IsProofOfWork())
return state.DoS(100, error("ConnectBlock() : PoW period ended"),
REJECT_INVALID, "PoW-ended");
Expand Down

0 comments on commit 722bdeb

Please sign in to comment.