test
This commit is contained in:
10
src/pow.cpp
10
src/pow.cpp
@@ -112,6 +112,7 @@ extern int32_t KOMODO_CHOSEN_ONE;
|
|||||||
|
|
||||||
bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned int nBits, const Consensus::Params& params)
|
bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned int nBits, const Consensus::Params& params)
|
||||||
{
|
{
|
||||||
|
extern int32_t KOMODO_REWIND;
|
||||||
bool fNegative,fOverflow; int32_t i,nonz=0,special,special2,notaryid,flag = 0;
|
bool fNegative,fOverflow; int32_t i,nonz=0,special,special2,notaryid,flag = 0;
|
||||||
arith_uint256 bnTarget;
|
arith_uint256 bnTarget;
|
||||||
|
|
||||||
@@ -146,13 +147,14 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
if ( UintToArith256(hash) > bnTarget )
|
if ( UintToArith256(hash) > bnTarget )
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<32; i++)
|
for (i=31; i>=0; i--)
|
||||||
printf("%02x",((uint8_t *)&hash)[i]);
|
printf("%02x",((uint8_t *)&hash)[i]);
|
||||||
printf(" hash vs ");
|
printf(" hash vs ");
|
||||||
for (i=0; i<32; i++)
|
for (i=31; i>=0; i--)
|
||||||
printf("%02x",((uint8_t *)&bnTarget)[i]);
|
printf("%02x",((uint8_t *)&bnTarget)[i]);
|
||||||
printf(" special.%d notaryid.%d ht.%d mod.%d error\n",special,notaryid,height,(height % 35));
|
printf(" REWIND.%d special.%d notaryid.%d ht.%d mod.%d error\n",KOMODO_REWIND,special,notaryid,height,(height % 35));
|
||||||
return error("CheckProofOfWork(): hash doesn't match nBits");
|
if ( height <= KOMODO_REWIND )
|
||||||
|
return error("CheckProofOfWork(): hash doesn't match nBits");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user