Browse Source

test

metaverse
jl777 8 years ago
parent
commit
0d2cefb06c
  1. 2
      src/main.cpp
  2. 6
      src/pow.cpp

2
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");
}
}

6
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(&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");

Loading…
Cancel
Save