@@ -557,11 +557,11 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33])
|
||||
{
|
||||
if ( komodo_minerid(height-i) == notaryid )
|
||||
{
|
||||
//fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d\n",height,notaryid,i);
|
||||
fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d\n",height,notaryid,i);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
//fprintf(stderr,"special notaryid.%d ht.%d limit.%d\n",notaryid,height,limit);
|
||||
fprintf(stderr,"special notaryid.%d ht.%d limit.%d\n",notaryid,height,limit);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
|
||||
13
src/pow.cpp
13
src/pow.cpp
@@ -108,7 +108,7 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33)
|
||||
int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]);
|
||||
int32_t komodo_currentheight();
|
||||
extern int32_t KOMODO_CHOSEN_ONE;
|
||||
//extern int8_t Minerids[1024 * 1024 * 5]; // 5 million blocks
|
||||
#define KOMODO_ELECTION_GAP 2000
|
||||
|
||||
bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned int nBits, const Consensus::Params& params)
|
||||
{
|
||||
@@ -128,13 +128,12 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
||||
}
|
||||
if ( nonz == 0 )
|
||||
return(true); // will come back via different path with pubkey set
|
||||
if ( notaryid >= 0 )
|
||||
special2 = komodo_is_special(height,pubkey33);
|
||||
if ( notaryid >= 0 && (height <= 90000 || (height % KOMODO_ELECTION_GAP) > 64) )
|
||||
{
|
||||
special2 = komodo_is_special(height,pubkey33);
|
||||
if ( special2 == -2 )
|
||||
printf("height.%d special2.%d special.%d\n",height,special2,special);
|
||||
if ( special2 == -2 || (height < 80000 && (special != 0 || special2 > 0)) ||
|
||||
(height >= 80000 && special2 > 0) )
|
||||
//if ( special2 == -2 )
|
||||
// printf("height.%d special2.%d special.%d\n",height,special2,special);
|
||||
if ( height < 90000 || (height % KOMODO_ELECTION_GAP) == 0 || (height < 80000 && (special != 0 || special2 > 0)) || (height >= 80000 && special2 > 0) )
|
||||
{
|
||||
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||
flag = 1;
|
||||
|
||||
Reference in New Issue
Block a user