diff --git a/src/main.cpp b/src/main.cpp index 78877dd28..8ce789b26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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"); } } diff --git a/src/pow.cpp b/src/pow.cpp index e76d78749..43c68b322 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -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(¬aryid,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");