mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-31 11:00:23 +00:00
Enforce rippling constraints between offers and direct steps
This commit is contained in:
@@ -589,6 +589,7 @@ TER DirectStepI::check (StrandContext const& ctx) const
|
||||
return temBAD_PATH;
|
||||
}
|
||||
|
||||
auto sleLine = ctx.view.read (keylet::line (src_, dst_, currency_));
|
||||
{
|
||||
auto sleSrc = ctx.view.read (keylet::account (src_));
|
||||
if (!sleSrc)
|
||||
@@ -599,8 +600,6 @@ TER DirectStepI::check (StrandContext const& ctx) const
|
||||
return terNO_ACCOUNT;
|
||||
}
|
||||
|
||||
auto sleLine = ctx.view.read (keylet::line (src_, dst_, currency_));
|
||||
|
||||
if (!sleLine)
|
||||
{
|
||||
JLOG (j_.trace()) << "DirectStepI: No credit line. " << *this;
|
||||
@@ -637,6 +636,18 @@ TER DirectStepI::check (StrandContext const& ctx) const
|
||||
if (ter != tesSUCCESS)
|
||||
return ter;
|
||||
}
|
||||
|
||||
if (fix1449(ctx.view.info().parentCloseTime))
|
||||
{
|
||||
if (ctx.prevStep->bookStepBook())
|
||||
{
|
||||
auto const noRippleSrcToDst =
|
||||
((*sleLine)[sfFlags] &
|
||||
((src_ > dst_) ? lsfHighNoRipple : lsfLowNoRipple));
|
||||
if (noRippleSrcToDst)
|
||||
return terNO_RIPPLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user