This commit is contained in:
jl777
2017-02-02 18:50:05 +02:00
parent c506035af6
commit 353af8aa92
3 changed files with 29 additions and 26 deletions

View File

@@ -633,6 +633,26 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33)
return(komodo_electednotary(pubkey33,height));
}
int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height)
{
int32_t i,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33];
memset(mids,-1,sizeof(*mids)*66);
for (i=duplicate=0; i<66; i++)
{
if ( (pindex= komodo_chainactive(height-i)) != 0 )
{
komodo_index2pubkey33(pubkey33,pindex,height-i);
if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 )
(*nonzpkeysp)++;
if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] )
duplicate++;
}
}
if ( i == 66 && duplicate == 0 && *nonzpkeysp > 0 )
return(1);
else return(0);
}
int32_t komodo_minerids(uint8_t *minerids,int32_t height,int32_t width)
{
int32_t i,n=0;