Miner fixes
This commit is contained in:
@@ -3234,6 +3234,8 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
|
||||
fprintf(stderr,"CheckBlockHeader error in CheckBlock\n");
|
||||
return false;
|
||||
}
|
||||
if ( fCheckPOW && !CheckEquihashSolution(&block, Params()) )
|
||||
return state.DoS(100, error("CheckBlockHeader(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution");
|
||||
komodo_block2pubkey33(pubkey33,(CBlock *)&block);
|
||||
if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()) )
|
||||
return state.DoS(50, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash");
|
||||
|
||||
@@ -861,6 +861,12 @@ void static BitcoinMiner()
|
||||
// fprintf(stderr," missed target\n");
|
||||
return false;
|
||||
}
|
||||
CValidationState tmpstate;
|
||||
if ( !TestBlockValidity(tmpstate, *pblock, pindexPrev, true, false))
|
||||
{
|
||||
fprintf(stderr,"formerly valid mining block became invalid\n");
|
||||
break;
|
||||
}
|
||||
if ( /*ASSETCHAINS_SYMBOL[0] == 0 &&*/ Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay )
|
||||
{
|
||||
//printf("Round robin diff sleep %d\n",(int32_t)(Mining_start+roundrobin_delay-time(NULL)));
|
||||
@@ -1002,12 +1008,6 @@ void static BitcoinMiner()
|
||||
// Changing pblock->nTime can change work required on testnet:
|
||||
hashTarget.SetCompact(pblock->nBits);
|
||||
}
|
||||
CValidationState tmpstate;
|
||||
if ( !TestBlockValidity(tmpstate, *pblock, pindexPrev, true, false))
|
||||
{
|
||||
fprintf(stderr,"formerly valid mining block became invalid, likely due to tx expiration\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user