Mining fix
This commit is contained in:
@@ -3509,7 +3509,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl
|
|||||||
// return state.DoS(100, error("CheckBlockHeader(): block version too low"),REJECT_INVALID, "version-too-low");
|
// return state.DoS(100, error("CheckBlockHeader(): block version too low"),REJECT_INVALID, "version-too-low");
|
||||||
|
|
||||||
// Check Equihash solution is valid
|
// Check Equihash solution is valid
|
||||||
if ( fCheckPOW && !CheckEquihashSolution(&blockhdr, Params()) )
|
/*if ( fCheckPOW && !CheckEquihashSolution(&blockhdr, Params()) )
|
||||||
return state.DoS(100, error("CheckBlockHeader(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution");
|
return state.DoS(100, error("CheckBlockHeader(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution");
|
||||||
|
|
||||||
// Check proof of work matches claimed amount
|
// Check proof of work matches claimed amount
|
||||||
@@ -3568,12 +3568,11 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
|
|||||||
fprintf(stderr,"checkblockheader error PoW.%d\n",fCheckPOW);
|
fprintf(stderr,"checkblockheader error PoW.%d\n",fCheckPOW);
|
||||||
return false;
|
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);
|
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);
|
|
||||||
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.
|
||||||
if (fCheckMerkleRoot) {
|
if (fCheckMerkleRoot) {
|
||||||
bool mutated;
|
bool mutated;
|
||||||
|
|||||||
@@ -918,6 +918,12 @@ void static BitcoinMiner()
|
|||||||
// fprintf(stderr," missed target\n");
|
// fprintf(stderr," missed target\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CValidationState state;
|
||||||
|
if ( !TestBlockValidity(state, *pblock, chainActive.Tip(), true, false))
|
||||||
|
{
|
||||||
|
fprintf(stderr,"Invalid block mined, try again\n");
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
if ( ASSETCHAINS_STAKED == 0 )
|
if ( ASSETCHAINS_STAKED == 0 )
|
||||||
{
|
{
|
||||||
if ( Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay )
|
if ( Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay )
|
||||||
@@ -935,12 +941,6 @@ void static BitcoinMiner()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CValidationState state;
|
|
||||||
if ( !TestBlockValidity(state, *pblock, chainActive.Tip(), true, false))
|
|
||||||
{
|
|
||||||
fprintf(stderr,"Invalid block mined, try again\n");
|
|
||||||
return(false);
|
|
||||||
}
|
|
||||||
if ( NOTARY_PUBKEY33[0] != 0 )
|
if ( NOTARY_PUBKEY33[0] != 0 )
|
||||||
{
|
{
|
||||||
printf("need to wait %d seconds to submit\n",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
printf("need to wait %d seconds to submit\n",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
||||||
|
|||||||
Reference in New Issue
Block a user