test
This commit is contained in:
@@ -608,12 +608,16 @@ void komodo_connectpindex(CBlockIndex *pindex)
|
||||
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height);
|
||||
int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height);
|
||||
|
||||
int8_t komodo_minerid(int32_t height)
|
||||
int8_t komodo_minerid(int32_t height,uint8_t *pubkey33)
|
||||
{
|
||||
int32_t num,i; CBlockIndex *pindex; uint8_t pubkey33[33],pubkeys[64][33];
|
||||
int32_t num,i; CBlockIndex *pindex; uint8_t _pubkey33[33],pubkeys[64][33];
|
||||
if ( (pindex= chainActive[height]) != 0 )
|
||||
{
|
||||
komodo_index2pubkey33(pubkey33,pindex,height);
|
||||
if ( pubkey33 == 0 )
|
||||
{
|
||||
pubkey33 = _pubkey33;
|
||||
komodo_index2pubkey33(pubkey33,pindex,height);
|
||||
}
|
||||
if ( (num= komodo_notaries(pubkeys,height)) > 0 )
|
||||
{
|
||||
for (i=0; i<num; i++)
|
||||
@@ -631,7 +635,7 @@ int32_t komodo_minerids(uint8_t *minerids,int32_t height,int32_t width)
|
||||
{
|
||||
if ( height-i <= 0 )
|
||||
break;
|
||||
minerids[i] = komodo_minerid(height - i);
|
||||
minerids[i] = komodo_minerid(height - i,0);
|
||||
}
|
||||
return(n);
|
||||
}
|
||||
@@ -649,7 +653,7 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33])
|
||||
else limit = 66;
|
||||
for (i=1; i<limit; i++)
|
||||
{
|
||||
if ( komodo_minerid(height-i) == notaryid )
|
||||
if ( komodo_minerid(height-i,pubkey33) == notaryid )
|
||||
{
|
||||
//fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d\n",height,notaryid,i);
|
||||
return(-1);
|
||||
|
||||
Reference in New Issue
Block a user