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