Merge pull request #113 from jl777/master

master
This commit is contained in:
SHossain
2019-01-09 13:06:00 +00:00
committed by GitHub
4 changed files with 11 additions and 3 deletions

View File

@@ -1701,6 +1701,7 @@ void komodo_args(char *argv0)
} }
} }
KOMODO_STOPAT = GetArg("-stopat",0); KOMODO_STOPAT = GetArg("-stopat",0);
MAX_REORG_LENGTH = GetArg("-maxreorg",MAX_REORG_LENGTH);
ASSETCHAINS_CC = GetArg("-ac_cc",0); ASSETCHAINS_CC = GetArg("-ac_cc",0);
KOMODO_CCACTIVATE = GetArg("-ac_ccactivate",0); KOMODO_CCACTIVATE = GetArg("-ac_ccactivate",0);
ASSETCHAINS_PUBLIC = GetArg("-ac_public",0); ASSETCHAINS_PUBLIC = GetArg("-ac_public",0);

View File

@@ -3170,6 +3170,13 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
//fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock); //fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock);
return false; return false;
} }
if ( fCheckPOW != 0 && !ContextualCheckBlock(block, state, pindex->pprev) ) // Activate Jan 15th, 2019
{
fprintf(stderr,"ContextualCheckBlock failed ht.%d\n",(int32_t)pindex->GetHeight());
if ( pindex->nTime > 1547510400 )
return false;
fprintf(stderr,"grandfathered exception, until jan 15th 2019\n");
}
// verify that the view's current state corresponds to the previous block // verify that the view's current state corresponds to the previous block
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash(); uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
@@ -4071,7 +4078,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
// then pindexFork will be null, and we would need to remove the entire chain including // then pindexFork will be null, and we would need to remove the entire chain including
// our genesis block. In practice this (probably) won't happen because of checks elsewhere. // our genesis block. In practice this (probably) won't happen because of checks elsewhere.
auto reorgLength = pindexOldTip ? pindexOldTip->GetHeight() - (pindexFork ? pindexFork->GetHeight() : -1) : 0; auto reorgLength = pindexOldTip ? pindexOldTip->GetHeight() - (pindexFork ? pindexFork->GetHeight() : -1) : 0;
static_assert(MAX_REORG_LENGTH > 0, "We must be able to reorg some distance"); assert(MAX_REORG_LENGTH > 0);//, "We must be able to reorg some distance");
if (reorgLength > MAX_REORG_LENGTH) if (reorgLength > MAX_REORG_LENGTH)
{ {
int32_t notarizedht,prevMoMheight; uint256 notarizedhash,txid; int32_t notarizedht,prevMoMheight; uint256 notarizedhash,txid;

View File

@@ -63,7 +63,7 @@ static const bool DEFAULT_ALERTS = true;
/** Minimum alert priority for enabling safe mode. */ /** Minimum alert priority for enabling safe mode. */
static const int ALERT_PRIORITY_SAFE_MODE = 4000; static const int ALERT_PRIORITY_SAFE_MODE = 4000;
/** Maximum reorg length we will accept before we shut down and alert the user. */ /** Maximum reorg length we will accept before we shut down and alert the user. */
static const unsigned int MAX_REORG_LENGTH = _COINBASE_MATURITY - 1; static unsigned int MAX_REORG_LENGTH = _COINBASE_MATURITY - 1;
/** Maximum number of signature check operations in an IsStandard() P2SH script */ /** Maximum number of signature check operations in an IsStandard() P2SH script */
static const unsigned int MAX_P2SH_SIGOPS = 15; static const unsigned int MAX_P2SH_SIGOPS = 15;
/** The maximum number of sigops we're willing to relay/mine in a single tx */ /** The maximum number of sigops we're willing to relay/mine in a single tx */

View File

@@ -56,7 +56,7 @@ extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
uint32_t komodo_segid32(char *coinaddr); uint32_t komodo_segid32(char *coinaddr);
int64_t komodo_coinsupply(int64_t *zfundsp,int64_t *sproutfundsp,int32_t height); int64_t komodo_coinsupply(int64_t *zfundsp,int64_t *sproutfundsp,int32_t height);
int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heightp); int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heightp);
#define KOMODO_VERSION "0.3.3" #define KOMODO_VERSION "0.3.3b"
#define VERUS_VERSION "0.4.0g" #define VERUS_VERSION "0.4.0g"
extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT; extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
extern uint32_t ASSETCHAINS_CC; extern uint32_t ASSETCHAINS_CC;