This commit is contained in:
jl777
2018-04-16 05:02:26 +03:00
parent 9a0f279889
commit 3283cb53e7
2 changed files with 8 additions and 5 deletions

View File

@@ -3564,12 +3564,15 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
// Check that the header is valid (particularly PoW). This is mostly // Check that the header is valid (particularly PoW). This is mostly
// redundant with the call in AcceptBlockHeader. // redundant with the call in AcceptBlockHeader.
if (!CheckBlockHeader(height,pindex,block,state,fCheckPOW)) if (!CheckBlockHeader(height,pindex,block,state,fCheckPOW))
{
fprintf(stderr,"checkblockheader error\n");
return false; return false;
//komodo_index2pubkey33(pubkey33,pindex,height); }
komodo_block2pubkey33(pubkey33,(CBlock *)&block); komodo_block2pubkey33(pubkey33,(CBlock *)&block);
if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()) ) if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()) )
{ {
komodo_reverify_blockcheck(state,height,pindex); //komodo_reverify_blockcheck(state,height,pindex);
return state.DoS(1, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash"); return state.DoS(1, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash");
} }
// Check the merkle root. // Check the merkle root.
@@ -3626,7 +3629,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
//if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : pindex != 0 ? (int32_t)pindex->nHeight : chainActive.Tip()->nHeight+1,block,pindex==0||pindex->pprev==0?0:pindex->pprev->nTime) < 0 ) //if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : pindex != 0 ? (int32_t)pindex->nHeight : chainActive.Tip()->nHeight+1,block,pindex==0||pindex->pprev==0?0:pindex->pprev->nTime) < 0 )
{ {
static uint32_t counter; static uint32_t counter;
if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 ) //if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 )
fprintf(stderr,"check deposit rejection\n"); fprintf(stderr,"check deposit rejection\n");
return(false); return(false);
} }

View File

@@ -491,8 +491,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false))
{ {
static uint32_t counter; static uint32_t counter;
if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 ) //if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 )
fprintf(stderr,"warning: testblockvalidity failed\n"); fprintf(stderr,"warning: miner testblockvalidity failed\n");
return(0); return(0);
} }
} }