Browse Source

Test

pull/4/head
jl777 6 years ago
parent
commit
5877c76ea2
  1. 9
      src/komodo_ccdata.h

9
src/komodo_ccdata.h

@ -85,9 +85,10 @@ int32_t komodo_MoMoMdata(char *hexstr,int32_t hexsize,struct komodo_ccdataMoMoM
{
max += 100;
tree = (bits256 *)realloc(tree,sizeof(*tree)*max);
//fprintf(stderr,"tree reallocated to %p max.%d\n",tree,max);
fprintf(stderr,"tree reallocated to %p max.%d\n",tree,max);
}
memcpy(&tree[offset++],&ccdata->MoMdata.MoM,sizeof(bits256));
memcpy(&tree[offset],&ccdata->MoMdata.MoM,sizeof(bits256));
offset++;
starti = ccdata->MoMdata.height;
}
}
@ -98,6 +99,7 @@ int32_t komodo_MoMoMdata(char *hexstr,int32_t hexsize,struct komodo_ccdataMoMoM
{
if ( tree != 0 && offset > 0 )
{
tree = (bits256 *)realloc(tree,sizeof(*tree)*(offset * 3));
tmp = iguana_merkle(tree,offset);
memcpy(&MoMoM,&tmp,sizeof(MoMoM));
mdata->MoMoM = MoMoM;
@ -129,7 +131,10 @@ int32_t komodo_MoMoMdata(char *hexstr,int32_t hexsize,struct komodo_ccdataMoMoM
}
}
if ( tree != 0 )
{
fprintf(stderr,"free tree.%p\n",tree);
free(tree);
}
return(retval);
}

Loading…
Cancel
Save