Ejemplo n.º 1
0
TER PathCursor::advanceNode (STAmount const& amount, bool reverse) const
{
    bool multi = multiQuality_ || amount == zero;

    // If the multiQuality_ is unchanged, use the PathCursor we're using now.
    if (multi == multiQuality_)
        return advanceNode (reverse);

    // Otherwise, use a new PathCursor with the new multiQuality_.
    PathCursor withMultiQuality {rippleCalc_, pathState_, multi, nodeIndex_};
    return withMultiQuality.advanceNode (reverse);
}
Ejemplo n.º 2
0
TER PathCursor::advanceNode (STAmount const& amount, bool reverse, bool callerHasLiquidity) const
{
    bool const multi = fix1141 (view ().info ().parentCloseTime)
        ? (multiQuality_ || (!callerHasLiquidity && amount == beast::zero))
        : (multiQuality_ || amount == beast::zero);

    // If the multiQuality_ is unchanged, use the PathCursor we're using now.
    if (multi == multiQuality_)
        return advanceNode (reverse);

    // Otherwise, use a new PathCursor with the new multiQuality_.
    PathCursor withMultiQuality {rippleCalc_, pathState_, multi, j_, nodeIndex_};
    return withMultiQuality.advanceNode (reverse);
}