memset Outside loop

This commit is contained in:
jl777
2019-01-12 01:00:08 -11:00
parent 2362f1226c
commit f816960557

View File

@@ -117,9 +117,9 @@ int32_t MarmaraValidateCoinbase(int32_t height,CTransaction tx)
struct CCcontract_info *cp,C; CPubKey pk; int32_t ht,unlockht; CTxOut ccvout;
cp = CCinit(&C,EVAL_MARMARA);
int32_t d,histo[365*2];
memset(histo,0,sizeof(histo));
for (ht=2; ht<1000000; ht+=MARMARA_GROUPSIZE)
{
memset(histo,0,sizeof(histo));
d = (MarmaraUnlockht(ht) - ht) / 1440;
if ( d < 0 || d > sizeof(histo)/sizeof(*histo) )
fprintf(stderr,"d error.%d at ht.%d\n",d,ht);
@@ -127,7 +127,7 @@ int32_t MarmaraValidateCoinbase(int32_t height,CTransaction tx)
}
for (ht=0; ht<sizeof(histo)/sizeof(*histo); ht++)
fprintf(stderr,"%d ",histo[ht]);
fprintf(stderr,"<- unlock histogram by days locked\n");
fprintf(stderr,"<- unlock histogram[%d] by days locked\n",(int32_t)(sizeof(histo)/sizeof(*histo)));
if ( (height & 1) != 0 )
return(0);
if ( tx.vout.size() == 2 && tx.vout[1].nValue == 0 )