Speed up npoints

This commit is contained in:
jl777
2017-10-23 15:49:13 +03:00
parent 78b3ac8f87
commit ebfe4120fb

View File

@@ -331,6 +331,8 @@ int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *n
if ( sp->last_NPOINTSi < sp->NUM_NPOINTS && sp->last_NPOINTSi > 0 ) if ( sp->last_NPOINTSi < sp->NUM_NPOINTS && sp->last_NPOINTSi > 0 )
{ {
np = &sp->NPOINTS[sp->last_NPOINTSi-1]; np = &sp->NPOINTS[sp->last_NPOINTSi-1];
if ( np->nHeight < nHeight )
{
for (i=sp->last_NPOINTSi; i<sp->NUM_NPOINTS; i++) for (i=sp->last_NPOINTSi; i<sp->NUM_NPOINTS; i++)
{ {
if ( sp->NPOINTS[i].nHeight >= nHeight ) if ( sp->NPOINTS[i].nHeight >= nHeight )
@@ -342,6 +344,7 @@ int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *n
sp->last_NPOINTSi = i; sp->last_NPOINTSi = i;
} }
} }
}
if ( flag == 0 ) if ( flag == 0 )
{ {
np = 0; np = 0;