This commit is contained in:
jl777
2016-11-10 08:57:09 -03:00
parent e2cf55f2c2
commit 0d2cefb06c
2 changed files with 5 additions and 3 deletions

View File

@@ -4896,7 +4896,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
int nDoS;
if (state.IsInvalid(nDoS)) {
if (nDoS > 0)
Misbehaving(pfrom->GetId(), nDoS);
Misbehaving(pfrom->GetId(), nDoS/nDoS);
return error("invalid header received");
}
}

View File

@@ -113,6 +113,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
arith_uint256 bnTarget;
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
if ( height == 0 )
height = chainActive.Tip()->nHeight + 1;
if ( height > 34000 ) // 0 -> non-special notary
{
special = komodo_chosennotary(&notaryid,height,pubkey33);
@@ -139,7 +141,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
flag = 1;
} //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];
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;
notaryid = -1;
printf("KOMODO_CHOSEN_ONE -> MINDIFF\n");
}
}*/
// Check range
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
return error("CheckProofOfWork(): nBits below minimum work");