mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-31 19:10:25 +00:00
Cleanup fix1449
This commit is contained in:
@@ -595,7 +595,6 @@ 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)
|
||||
@@ -606,6 +605,8 @@ TER DirectStepI::check (StrandContext const& ctx) const
|
||||
return terNO_ACCOUNT;
|
||||
}
|
||||
|
||||
auto const sleLine = ctx.view.read (keylet::line (src_, dst_, currency_));
|
||||
|
||||
if (!sleLine)
|
||||
{
|
||||
JLOG (j_.trace()) << "DirectStepI: No credit line. " << *this;
|
||||
@@ -623,39 +624,40 @@ TER DirectStepI::check (StrandContext const& ctx) const
|
||||
<< " src: " << src_;
|
||||
return terNO_AUTH;
|
||||
}
|
||||
}
|
||||
|
||||
// pure issue/redeem can't be frozen
|
||||
if (! (ctx.isLast && ctx.isFirst))
|
||||
{
|
||||
auto const ter = checkFreeze (ctx.view, src_, dst_, currency_);
|
||||
if (ter != tesSUCCESS)
|
||||
return ter;
|
||||
}
|
||||
|
||||
if (ctx.prevStep)
|
||||
{
|
||||
if (auto prevSrc = ctx.prevStep->directStepSrcAcct ())
|
||||
// pure issue/redeem can't be frozen
|
||||
if (!(ctx.isLast && ctx.isFirst))
|
||||
{
|
||||
auto const ter =
|
||||
checkNoRipple (ctx.view, *prevSrc, src_, dst_, currency_, j_);
|
||||
auto const ter = checkFreeze(ctx.view, src_, dst_, currency_);
|
||||
if (ter != tesSUCCESS)
|
||||
return ter;
|
||||
}
|
||||
|
||||
if (fix1449(ctx.view.info().parentCloseTime))
|
||||
if (ctx.prevStep)
|
||||
{
|
||||
if (ctx.prevStep->bookStepBook())
|
||||
if (auto prevSrc = ctx.prevStep->directStepSrcAcct())
|
||||
{
|
||||
auto const noRippleSrcToDst =
|
||||
((*sleLine)[sfFlags] &
|
||||
((src_ > dst_) ? lsfHighNoRipple : lsfLowNoRipple));
|
||||
if (noRippleSrcToDst)
|
||||
return terNO_RIPPLE;
|
||||
auto const ter = checkNoRipple(
|
||||
ctx.view, *prevSrc, src_, dst_, currency_, j_);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Issue const srcIssue{currency_, src_};
|
||||
Issue const dstIssue{currency_, dst_};
|
||||
|
||||
Reference in New Issue
Block a user