From 722bdebfb9aefd81a13888f127bd51ce75331f6f Mon Sep 17 00:00:00 2001 From: cevap Date: Fri, 30 Mar 2018 04:32:24 +0200 Subject: [PATCH] Remove warning during compilation, fixed #9 --- src/main.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 123dc71cbad0f..a8aa73dafad80 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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");