Easy diff for PoS

This commit is contained in:
jl777
2018-07-10 04:53:28 -11:00
parent 38cbe99ba4
commit f108acf943
4 changed files with 3 additions and 11 deletions

View File

@@ -127,7 +127,6 @@ extern int32_t KOMODO_CHOSEN_ONE;
extern uint64_t ASSETCHAINS_STAKED;
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
#define KOMODO_ELECTION_GAP 2000
#define KOMODO_MAXPOS_DIFF 16
int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,uint32_t blocktimes[66],int32_t *nonzpkeysp,int32_t height);
int32_t KOMODO_LOADINGBLOCKS = 1;
@@ -194,10 +193,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
if ( ASSETCHAINS_STAKED != 0 )
{
arith_uint256 bnMaxPoSdiff;
bnMaxPoSdiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
bnMaxPoSdiff = (bnMaxPoSdiff / arith_uint256(KOMODO_MAXPOS_DIFF));
if ( bnTarget < bnMaxPoSdiff )
bnTarget = bnMaxPoSdiff;
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
}
// Check proof of work matches claimed amount
if ( UintToArith256(hash) > bnTarget )