Test
This commit is contained in:
@@ -643,8 +643,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
|
||||
// MoMoM, depth, numpairs, (notarization ht, MoMoM offset)
|
||||
if ( len+44-opoffset <= opretlen && strcmp(ccdata.symbol,ASSETCHAINS_SYMBOL) == 0 )
|
||||
{
|
||||
len += iguana_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.MoMoMstart);
|
||||
len += iguana_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.MoMoMend);
|
||||
len += iguana_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.MoMoMstarti);
|
||||
len += iguana_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.MoMoMendi);
|
||||
len += iguana_rwbignum(0,&scriptbuf[len],sizeof(MoMoMdata.MoMoM),(uint8_t *)&MoMoMdata.MoMoM);
|
||||
len += iguana_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.numpairs);
|
||||
MoMoMdata.len += sizeof(MoMoMdata.MoMoM) + sizeof(uint32_t)*3;
|
||||
|
||||
@@ -92,7 +92,7 @@ char *komodo_MoMoMdata(char *symbol,int32_t kmdheight,int32_t notarized_height)
|
||||
if ( offset >= max )
|
||||
{
|
||||
max += 100;
|
||||
tree = realloc(sizeof(*tree),max);
|
||||
tree = (bits256 *)realloc(sizeof(*tree),max);
|
||||
}
|
||||
memcpy(&tree[offset++],&ccdata->MoMdata.MoM,sizeof(bits256));
|
||||
starti = ccdata->MoMdata.height;
|
||||
@@ -100,19 +100,19 @@ char *komodo_MoMoMdata(char *symbol,int32_t kmdheight,int32_t notarized_height)
|
||||
}
|
||||
portable_mutex_unlock(&KOMODO_CC_mutex);
|
||||
retjson = cJSON_CreateObject();
|
||||
jaddnum(retjson,"kmdstarti",starti);
|
||||
jaddnum(retjson,"kmdendi",endi);
|
||||
jaddnum(retjson,(char *)"kmdstarti",starti);
|
||||
jaddnum(retjson,(char *)"kmdendi",endi);
|
||||
if ( starti != 0 && endi != 0 && endi >= starti )
|
||||
{
|
||||
if ( tree != 0 && offset > 0 )
|
||||
{
|
||||
MoMoM = iguana_merkle(tree,offset);
|
||||
jaddbits256(retjson,"MoMoM",MoMoM);
|
||||
jaddbits256(retjson,(char *)"MoMoM",MoMoM);
|
||||
}
|
||||
}
|
||||
if ( tree != 0 )
|
||||
free(tree);
|
||||
jadd(retjson,"offsets",pairs);
|
||||
jadd(retjson,(char *)"offsets",pairs);
|
||||
return(jprint(retjson,1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user