This commit is contained in:
jl777
2016-12-01 17:04:15 -03:00
parent ba0a297f16
commit 8c072b0bce

View File

@@ -382,19 +382,14 @@ uint64_t komodo_seed(int32_t height)
if ( height > 10 ) if ( height > 10 )
height -= 10; height -= 10;
if ( ASSETCHAINS_SYMBOL[0] == 0 ) if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
hash = _komodo_getblockhash(height); hash = _komodo_getblockhash(height);
while ( memcmp(&hash,&zero,sizeof(hash)) == 0 ) if ( memcmp(&hash,&zero,sizeof(hash)) == 0 )
{ hash = komodo_getblockhash(height);
fprintf(stderr,"null seed for height.%d, sleep\n",height); int32_t i;
sleep(3); for (i=0; i<32; i++)
} printf("%02x",((uint8_t *)&hash)[i]);
int32_t i; printf(" seed.%d\n",height);
for (i=0; i<32; i++) seed = arith_uint256(hash.GetHex()).GetLow64();
printf("%02x",((uint8_t *)&hash)[i]);
printf(" seed.%d\n",height);
} else hash = komodo_getblockhash(height);
seed = arith_uint256(hash.GetHex()).GetLow64();
return(seed); return(seed);
} }