From 562852ab08daf7431bd477a6d54bcf92a5904b8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 23 Jul 2018 20:26:23 -1100 Subject: [PATCH] Test --- src/miner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 79155259a..7e5c47f56 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -164,10 +164,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount) // Collect memory pool transactions into the block CAmount nFees = 0; - + CBlockIndex* pindexPrev = 0; { LOCK2(cs_main, mempool.cs); - CBlockIndex* pindexPrev = chainActive.LastTip(); + pindexPrev = chainActive.LastTip(); const int nHeight = pindexPrev->nHeight + 1; uint32_t consensusBranchId = CurrentEpochBranchId(nHeight, chainparams.GetConsensus()); pblock->nTime = GetAdjustedTime(); @@ -494,7 +494,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount) } } } - if ( ASSETCHAINS_STAKED == 0 ) + if ( pindexPrev != 0 && ASSETCHAINS_STAKED == 0 ) { CValidationState state; fprintf(stderr,"check validity\n");