Debug
This commit is contained in:
@@ -108,6 +108,7 @@ int32_t komodo_MoMoMdata(char *hexstr,int32_t hexsize,struct komodo_ccdataMoMoM
|
|||||||
len += iguana_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->MoMoMdepth);
|
len += iguana_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->MoMoMdepth);
|
||||||
len += iguana_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->numpairs);
|
len += iguana_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->numpairs);
|
||||||
mdata->pairs = (struct komodo_ccdatapair *)calloc(mdata->numpairs,sizeof(*mdata->pairs));
|
mdata->pairs = (struct komodo_ccdatapair *)calloc(mdata->numpairs,sizeof(*mdata->pairs));
|
||||||
|
fprintf(stderr,"pairs allocated to %p num.%d\n",mdata->pairs,mdata->numpairs);
|
||||||
for (i=0; i<mdata->numpairs; i++)
|
for (i=0; i<mdata->numpairs; i++)
|
||||||
{
|
{
|
||||||
if ( len + sizeof(uint32_t)*2 > sizeof(hexdata) )
|
if ( len + sizeof(uint32_t)*2 > sizeof(hexdata) )
|
||||||
@@ -124,6 +125,7 @@ int32_t komodo_MoMoMdata(char *hexstr,int32_t hexsize,struct komodo_ccdataMoMoM
|
|||||||
if ( i == mdata->numpairs && len*2+1 < hexsize )
|
if ( i == mdata->numpairs && len*2+1 < hexsize )
|
||||||
{
|
{
|
||||||
init_hexbytes_noT(hexstr,hexdata,len);
|
init_hexbytes_noT(hexstr,hexdata,len);
|
||||||
|
jadd(retjson,(char *)"data",hexstr);
|
||||||
retval = 0;
|
retval = 0;
|
||||||
} else fprintf(stderr,"%s %d %d too much hexdata[%d] for hexstr[%d]\n",symbol,kmdheight,notarized_height,len,hexsize);
|
} else fprintf(stderr,"%s %d %d too much hexdata[%d] for hexstr[%d]\n",symbol,kmdheight,notarized_height,len,hexsize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,6 +603,7 @@ UniValue MoMoMdata(const UniValue& params, bool fHelp)
|
|||||||
ret.push_back(Pair("coin",symbol));
|
ret.push_back(Pair("coin",symbol));
|
||||||
ret.push_back(Pair("kmdheight",kmdheight));
|
ret.push_back(Pair("kmdheight",kmdheight));
|
||||||
ret.push_back(Pair("notarized_height",notarized_height));
|
ret.push_back(Pair("notarized_height",notarized_height));
|
||||||
|
memset(&mdata,0,sizeof(mdata));
|
||||||
if ( komodo_MoMoMdata(hexstr,sizeof(hexstr),&mdata,symbol,kmdheight,notarized_height) == 0 )
|
if ( komodo_MoMoMdata(hexstr,sizeof(hexstr),&mdata,symbol,kmdheight,notarized_height) == 0 )
|
||||||
{
|
{
|
||||||
ret.push_back(Pair("kmdstarti",mdata.kmdstarti));
|
ret.push_back(Pair("kmdstarti",mdata.kmdstarti));
|
||||||
@@ -612,6 +613,7 @@ UniValue MoMoMdata(const UniValue& params, bool fHelp)
|
|||||||
ret.push_back(Pair("numnotarizations",mdata.numpairs));
|
ret.push_back(Pair("numnotarizations",mdata.numpairs));
|
||||||
if ( mdata.pairs != 0 )
|
if ( mdata.pairs != 0 )
|
||||||
{
|
{
|
||||||
|
fprintf(stderr,"mdata.pairs free %p, numpairs.%d\n",mdata.pairs,mdata.numpairs);
|
||||||
for (i=0; i<mdata.numpairs; i++)
|
for (i=0; i<mdata.numpairs; i++)
|
||||||
{
|
{
|
||||||
UniValue item(UniValue::VOBJ);
|
UniValue item(UniValue::VOBJ);
|
||||||
|
|||||||
Reference in New Issue
Block a user