test
This commit is contained in:
@@ -4896,7 +4896,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
int nDoS;
|
int nDoS;
|
||||||
if (state.IsInvalid(nDoS)) {
|
if (state.IsInvalid(nDoS)) {
|
||||||
if (nDoS > 0)
|
if (nDoS > 0)
|
||||||
Misbehaving(pfrom->GetId(), nDoS);
|
Misbehaving(pfrom->GetId(), nDoS/nDoS);
|
||||||
return error("invalid header received");
|
return error("invalid header received");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
arith_uint256 bnTarget;
|
arith_uint256 bnTarget;
|
||||||
|
|
||||||
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
||||||
|
if ( height == 0 )
|
||||||
|
height = chainActive.Tip()->nHeight + 1;
|
||||||
if ( height > 34000 ) // 0 -> non-special notary
|
if ( height > 34000 ) // 0 -> non-special notary
|
||||||
{
|
{
|
||||||
special = komodo_chosennotary(¬aryid,height,pubkey33);
|
special = komodo_chosennotary(¬aryid,height,pubkey33);
|
||||||
@@ -139,7 +141,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
} //else bnTarget /= 8;
|
} //else bnTarget /= 8;
|
||||||
}
|
}
|
||||||
else if ( height == 0 && KOMODO_CHOSEN_ONE != 0 )
|
/*else if ( height == 0 && KOMODO_CHOSEN_ONE != 0 )
|
||||||
{
|
{
|
||||||
extern uint8_t NOTARY_PUBKEY33[33];
|
extern uint8_t NOTARY_PUBKEY33[33];
|
||||||
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||||
@@ -147,7 +149,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
special = 1;
|
special = 1;
|
||||||
notaryid = -1;
|
notaryid = -1;
|
||||||
printf("KOMODO_CHOSEN_ONE -> MINDIFF\n");
|
printf("KOMODO_CHOSEN_ONE -> MINDIFF\n");
|
||||||
}
|
}*/
|
||||||
// Check range
|
// Check range
|
||||||
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
|
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
|
||||||
return error("CheckProofOfWork(): nBits below minimum work");
|
return error("CheckProofOfWork(): nBits below minimum work");
|
||||||
|
|||||||
Reference in New Issue
Block a user