Test
This commit is contained in:
@@ -730,17 +730,22 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33)
|
|||||||
int32_t num,i,numnotaries; CBlockIndex *pindex; uint32_t timestamp=0; uint8_t _pubkey33[33],pubkeys[64][33];
|
int32_t num,i,numnotaries; CBlockIndex *pindex; uint32_t timestamp=0; uint8_t _pubkey33[33],pubkeys[64][33];
|
||||||
if ( pubkey33 == 0 && (pindex= chainActive[height]) != 0 )
|
if ( pubkey33 == 0 && (pindex= chainActive[height]) != 0 )
|
||||||
{
|
{
|
||||||
timestamp = pindex->GetBlockTime();
|
if ( pindex->pubkey33[0] == 0 )
|
||||||
if ( pubkey33 == 0 )
|
|
||||||
{
|
{
|
||||||
pubkey33 = _pubkey33;
|
pindex->notaryid = -1;
|
||||||
|
timestamp = pindex->GetBlockTime();
|
||||||
|
if ( pubkey33 == 0 )
|
||||||
|
pubkey33 = _pubkey33;
|
||||||
komodo_index2pubkey33(pubkey33,pindex,height);
|
komodo_index2pubkey33(pubkey33,pindex,height);
|
||||||
}
|
if ( (num= komodo_notaries(pubkeys,height,timestamp)) > 0 )
|
||||||
if ( (num= komodo_notaries(pubkeys,height,timestamp)) > 0 )
|
{
|
||||||
{
|
for (i=0; i<num; i++)
|
||||||
for (i=0; i<num; i++)
|
if ( memcmp(pubkeys[i],pubkey33,33) == 0 )
|
||||||
if ( memcmp(pubkeys[i],pubkey33,33) == 0 )
|
{
|
||||||
return(i);
|
pindex->notaryid = i;
|
||||||
|
return(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(komodo_electednotary(&numnotaries,pubkey33,height,timestamp));
|
return(komodo_electednotary(&numnotaries,pubkey33,height,timestamp));
|
||||||
@@ -755,8 +760,6 @@ int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *non
|
|||||||
if ( (pindex= komodo_chainactive(height-i)) != 0 )
|
if ( (pindex= komodo_chainactive(height-i)) != 0 )
|
||||||
{
|
{
|
||||||
komodo_index2pubkey33(pubkey33,pindex,height-i);
|
komodo_index2pubkey33(pubkey33,pindex,height-i);
|
||||||
//for (j=0; j<33; j++)
|
|
||||||
// pubkeys[i][j] = pubkey33[j];
|
|
||||||
memcpy(pubkeys[i],pubkey33,33);
|
memcpy(pubkeys[i],pubkey33,33);
|
||||||
if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 )
|
if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user