This commit is contained in:
jl777
2018-04-13 19:55:31 +03:00
parent 91e508ec62
commit 0bf0617577

View File

@@ -739,9 +739,9 @@ void komodo_pindex_init(CBlockIndex *pindex,int32_t height)
if ( komodo_blockload(block,pindex) == 0 ) if ( komodo_blockload(block,pindex) == 0 )
{ {
komodo_block2pubkey33(pindex->pubkey33,block); komodo_block2pubkey33(pindex->pubkey33,block);
//for (i=0; i<33; i++) for (i=0; i<33; i++)
// fprintf(stderr,"%02x",pindex->pubkey33[i]); fprintf(stderr,"%02x",pindex->pubkey33[i]);
//fprintf(stderr," set pubkey at height %d/%d\n",pindex->nHeight,height); fprintf(stderr," set pubkey at height %d/%d\n",pindex->nHeight,height);
//pindex->didinit = (KOMODO_LOADINGBLOCKS == 0); //pindex->didinit = (KOMODO_LOADINGBLOCKS == 0);
} // else fprintf(stderr,"error loading block at %d/%d",pindex->nHeight,height); } // else fprintf(stderr,"error loading block at %d/%d",pindex->nHeight,height);
} }
@@ -770,6 +770,11 @@ 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 ( komodo_blockload(block,pindex) == 0 )
{
komodo_block2pubkey33(pindex->pubkey33,block);
return;
}
if ( pindex->didinit != 0 ) if ( pindex->didinit != 0 )
{ {
memcpy(pubkey33,pindex->pubkey33,33); memcpy(pubkey33,pindex->pubkey33,33);