Fix off by ones
This commit is contained in:
@@ -818,7 +818,7 @@ int32_t komodo_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *kmdtxidp,in
|
||||
memset(MoMp,0,sizeof(*MoMp));
|
||||
memset(kmdtxidp,0,sizeof(*kmdtxidp));
|
||||
*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;
|
||||
*notarized_heightp = notarized_ht;
|
||||
|
||||
@@ -409,8 +409,8 @@ int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,in
|
||||
np = &sp->NPOINTS[i];
|
||||
if ( np->MoMdepth > 0 && nHeight > np->nHeight-np->MoMdepth && nHeight <= np->nHeight )
|
||||
{
|
||||
printf("komodo_MoMdata.(%s -> %s) %d i.%d np->ht %d MoMdepth.%d\n",symbol,dest,nHeight,i,np->nHeight,np->MoMdepth);
|
||||
*notarized_htp = np->nHeight;
|
||||
//printf("komodo_MoMdata.(%s -> %s) %d i.%d np->ht %d MoMdepth.%d\n",symbol,dest,nHeight,i,np->nHeight,np->MoMdepth);
|
||||
*notarized_htp = np->notarized_height;
|
||||
*MoMp = np->MoM;
|
||||
*kmdtxidp = np->notarized_desttxid;
|
||||
return(np->MoMdepth);
|
||||
|
||||
@@ -580,7 +580,7 @@ UniValue height_MoM(const UniValue& params, bool fHelp)
|
||||
}
|
||||
height = chainActive.Tip()->nHeight;
|
||||
}
|
||||
fprintf(stderr,"height_MoM height.%d\n",height);
|
||||
//fprintf(stderr,"height_MoM height.%d\n",height);
|
||||
depth = komodo_MoM(¬arized_height,&MoM,&kmdtxid,height);
|
||||
ret.push_back(Pair("coin",(char *)(ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL)));
|
||||
ret.push_back(Pair("height",height));
|
||||
|
||||
Reference in New Issue
Block a user