mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Enforce rippling constraints during payments
This commit is contained in:
@@ -684,6 +684,26 @@ BookStep<TIn, TOut>::check(StrandContext const& ctx) const
|
||||
return temBAD_PATH_LOOP;
|
||||
}
|
||||
|
||||
if (amendmentRIPD1443(ctx.view.info().parentCloseTime))
|
||||
{
|
||||
if (ctx.prevStep)
|
||||
{
|
||||
if (auto const prev = ctx.prevStep->directStepSrcAcct())
|
||||
{
|
||||
auto const& view = ctx.view;
|
||||
auto const& cur = book_.in.account;
|
||||
|
||||
auto sle =
|
||||
view.read(keylet::line(*prev, cur, book_.in.currency));
|
||||
if (!sle)
|
||||
return terNO_LINE;
|
||||
if ((*sle)[sfFlags] &
|
||||
((cur > *prev) ? lsfHighNoRipple : lsfLowNoRipple))
|
||||
return terNO_RIPPLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user