This commit is contained in:
jl777
2018-04-13 18:13:20 +03:00
parent 065505b795
commit d74896c5b4
2 changed files with 4 additions and 5 deletions

View File

@@ -770,7 +770,7 @@ void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height)
memset(pubkey33,0,33); memset(pubkey33,0,33);
if ( pindex != 0 ) if ( pindex != 0 )
{ {
if ( pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3 || pindex->pubkey33[0] == 0xff ) if ( pindex->didinit != 0 )
{ {
memcpy(pubkey33,pindex->pubkey33,33); memcpy(pubkey33,pindex->pubkey33,33);
return; return;
@@ -785,7 +785,7 @@ 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 ( (pindex= chainActive[height]) != 0 ) if ( (pindex= chainActive[height]) != 0 )
{ {
if ( pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3 || pindex->pubkey33[0] == 0xff ) if ( pindex->didinit != 0 )
{ {
if ( pubkey33 != 0 ) if ( pubkey33 != 0 )
memcpy(pubkey33,pindex->pubkey33,33); memcpy(pubkey33,pindex->pubkey33,33);
@@ -812,7 +812,7 @@ 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 )
{ {
if ( pindex->notaryid >= 0 && (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3 || pindex->pubkey33[0] == 0xff) ) if ( pindex->notaryid >= 0 && pindex->didinit != 0 )
{ {
memcpy(pubkeys[i],pindex->pubkey33,33); memcpy(pubkeys[i],pindex->pubkey33,33);
mids[i] = pindex->notaryid; mids[i] = pindex->notaryid;

View File

@@ -199,8 +199,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
printf(" ht.%d special.%d notaryid.%d ht.%d mod.%d error\n",height,special,notaryid,height,(height % 35)); printf(" ht.%d special.%d notaryid.%d ht.%d mod.%d error\n",height,special,notaryid,height,(height % 35));
if ( pindex != 0 ) if ( pindex != 0 )
{ {
pindex->notaryid = -1; pindex->didinit = 0;
memset(pindex->pubkey33,0,33);
komodo_pindex_init(pindex,height); komodo_pindex_init(pindex,height);
} }
for (i=0; i<33; i++) for (i=0; i<33; i++)