This commit is contained in:
jl777
2016-11-13 16:21:48 -03:00
parent ed652d8b89
commit 888cf827c9
3 changed files with 48 additions and 11 deletions

View File

@@ -470,11 +470,23 @@ int8_t komodo_minerid(int32_t height)
int32_t notaryid; CBlockIndex *pindex; uint8_t pubkey33[33];
if ( depth < 3 && height <= CURRENT_HEIGHT )//chainActive.Tip()->nHeight )
{
if ( Minerids[height] >= -1 )
return(Minerids[height]);
if ( (pindex= chainActive[height]) != 0 )
{
depth++;
komodo_index2pubkey33(pubkey33,pindex,height);
komodo_chosennotary(&notaryid,height,pubkey33);
if ( notaryid >= -1 )
{
Minerids[height] = notaryid;
if ( Minerfp != 0 )
{
fseek(Minerfp,height,SEEK_SET);
fputc(Minerids[height],Minerfp);
fflush(Minerfp);
}
}
depth--;
return(notaryid);
}