src/main.cpp
//
// maximum nBits value could possible be required nTime after
//
maximum nBits value could possible be required nTime after
maximum nBits value could possible be required nTime after
unsigned int ComputeMaxBits(CBigNum bnTargetLimit, unsigned int nBase, int64 nTime)
{
    CBigNum bnResult;
    bnResult.SetCompact(nBase);
    bnResult *= 2;
    while (nTime > 0 && bnResult < bnTargetLimit)
    {
        bnResult *= 2;
        nTime -= 4 * 60 * 60;
    }
    if (bnResult > bnTargetLimit)
        bnResult = bnTargetLimit;
    return bnResult.GetCompact();
}
unsigned int ComputeMaxBits ( CBigNum bnTargetLimit , unsigned int nBase , int64 nTime ) { CBigNum bnResult ; bnResult . SetCompact ( nBase ) ; bnResult *= 2 ; while ( nTime > 0 && bnResult < bnTargetLimit ) { bnResult *= 2 ; nTime -= 4 * 60 * 60 ; } if ( bnResult > bnTargetLimit ) bnResult = bnTargetLimit ; return bnResult . GetCompact ( ) ; }
maximum nBits value could possible be required nTime after
maximum nBits value could possible be required nTime after
// Maximum 200% adjustment per 4 hours