mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 16:05:51 +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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -347,6 +347,9 @@ bool amendmentRIPD1298 (NetClock::time_point const closeTime);
|
||||
NetClock::time_point const& amendmentRIPD1443SoTime ();
|
||||
bool amendmentRIPD1443 (NetClock::time_point const closeTime);
|
||||
|
||||
NetClock::time_point const& fix1449SoTime ();
|
||||
bool fix1449 (NetClock::time_point const closeTime);
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -86,6 +86,20 @@ bool amendmentRIPD1443 (NetClock::time_point const closeTime)
|
||||
return closeTime > amendmentRIPD1443SoTime();
|
||||
}
|
||||
|
||||
NetClock::time_point const& fix1449SoTime ()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
// Thurs, Mar 30, 2017 01:00:00pm PDT
|
||||
static NetClock::time_point const soTime{544219200s};
|
||||
|
||||
return soTime;
|
||||
}
|
||||
|
||||
bool fix1449 (NetClock::time_point const closeTime)
|
||||
{
|
||||
return closeTime > fix1449SoTime();
|
||||
}
|
||||
|
||||
// VFALCO NOTE A copy of the other one for now
|
||||
/** Maximum number of entries in a directory page
|
||||
A change would be protocol-breaking.
|
||||
|
||||
Reference in New Issue
Block a user