@@ -932,7 +932,7 @@ int32_t komodo_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *kmdtxidp,in
|
|||||||
memset(MoMp,0,sizeof(*MoMp));
|
memset(MoMp,0,sizeof(*MoMp));
|
||||||
memset(kmdtxidp,0,sizeof(*kmdtxidp));
|
memset(kmdtxidp,0,sizeof(*kmdtxidp));
|
||||||
*notarized_heightp = 0;
|
*notarized_heightp = 0;
|
||||||
if ( depth > 0 && notarized_ht > 0 && nHeight > notarized_ht-depth && nHeight <= notarized_ht )
|
if ( depth != 0 && notarized_ht > 0 && nHeight > notarized_ht-depth && nHeight <= notarized_ht )
|
||||||
{
|
{
|
||||||
*MoMp = MoM;
|
*MoMp = MoM;
|
||||||
*notarized_heightp = notarized_ht;
|
*notarized_heightp = notarized_ht;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ bits256 iguana_merkle(bits256 *tree,int32_t txn_count)
|
|||||||
uint256 komodo_calcMoM(int32_t height,int32_t MoMdepth)
|
uint256 komodo_calcMoM(int32_t height,int32_t MoMdepth)
|
||||||
{
|
{
|
||||||
static uint256 zero; bits256 MoM,*tree; CBlockIndex *pindex; int32_t i;
|
static uint256 zero; bits256 MoM,*tree; CBlockIndex *pindex; int32_t i;
|
||||||
|
MoMdepth &= 0xffff;
|
||||||
if ( MoMdepth >= height )
|
if ( MoMdepth >= height )
|
||||||
return(zero);
|
return(zero);
|
||||||
tree = (bits256 *)calloc(MoMdepth * 3,sizeof(*tree));
|
tree = (bits256 *)calloc(MoMdepth * 3,sizeof(*tree));
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ struct notarized_checkpoint *komodo_npptr(int32_t height)
|
|||||||
for (i=sp->NUM_NPOINTS-1; i>=0; i--)
|
for (i=sp->NUM_NPOINTS-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
np = &sp->NPOINTS[i];
|
np = &sp->NPOINTS[i];
|
||||||
if ( np->MoMdepth > 0 && height > np->notarized_height-np->MoMdepth && height <= np->notarized_height )
|
if ( np->MoMdepth != 0 && height > np->notarized_height-(np->MoMdepth&0xffff) && height <= np->notarized_height )
|
||||||
return(np);
|
return(np);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -447,7 +447,7 @@ int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,in
|
|||||||
*MoMoMdepthp = np->MoMoMdepth;
|
*MoMoMdepthp = np->MoMoMdepth;
|
||||||
*kmdstartip = np->kmdstarti;
|
*kmdstartip = np->kmdstarti;
|
||||||
*kmdendip = np->kmdendi;
|
*kmdendip = np->kmdendi;
|
||||||
return(np->MoMdepth);
|
return(np->MoMdepth & 0xffff);
|
||||||
}
|
}
|
||||||
*notarized_htp = *MoMoMoffsetp = *MoMoMdepthp = *kmdstartip = *kmdendip = 0;
|
*notarized_htp = *MoMoMoffsetp = *MoMoMdepthp = *kmdstartip = *kmdendip = 0;
|
||||||
memset(MoMp,0,sizeof(*MoMp));
|
memset(MoMp,0,sizeof(*MoMp));
|
||||||
|
|||||||
Reference in New Issue
Block a user