Merge pull request #736 from jl777/jl777

Jl777
This commit is contained in:
jl777
2018-07-08 00:14:49 -11:00
committed by GitHub
3 changed files with 4 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
Copyright (c) 2016-2018 The Komodo developers
Copyright (c) 2016-2017 The Zcash developers
Copyright (c) 2009-2017 The Bitcoin Core developers

View File

@@ -1406,7 +1406,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
strcpy(voutaddr,CBitcoinAddress(voutaddress).ToString().c_str());
if ( strcmp(destaddr,voutaddr) == 0 && pblock->vtx[txn_count-1].vout[0].nValue == value )
isPoS = 1; // close enough for a pre-filter
else fprintf(stderr,"komodo_is_PoSblock ht.%d (%s) != (%s) or %.8f != %.8f\n",height,destaddr,voutaddr,dstr(value),dstr(pblock->vtx[txn_count-1].vout[0].nValue));
//else fprintf(stderr,"komodo_is_PoSblock ht.%d (%s) != (%s) or %.8f != %.8f\n",height,destaddr,voutaddr,dstr(value),dstr(pblock->vtx[txn_count-1].vout[0].nValue));
} else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height);
} //else return(-1);
}

View File

@@ -190,6 +190,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
}
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
return error("CheckProofOfWork(): nBits below minimum work");
if ( height >= 4200 && ASSETCHAINS_STAKED != 0 )
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
// Check proof of work matches claimed amount
if ( UintToArith256(hash) > bnTarget )
{