mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +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;
|
||||
}
|
||||
|
||||
|
||||
@@ -344,6 +344,9 @@ bool amendmentRIPD1274 (NetClock::time_point const closeTime);
|
||||
NetClock::time_point const& amendmentRIPD1298SoTime ();
|
||||
bool amendmentRIPD1298 (NetClock::time_point const closeTime);
|
||||
|
||||
NetClock::time_point const& amendmentRIPD1443SoTime ();
|
||||
bool amendmentRIPD1443 (NetClock::time_point const closeTime);
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -72,6 +72,20 @@ bool amendmentRIPD1298 (NetClock::time_point const closeTime)
|
||||
return closeTime > amendmentRIPD1298SoTime();
|
||||
}
|
||||
|
||||
NetClock::time_point const& amendmentRIPD1443SoTime ()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
// Sat Mar 11, 2017 05:00:00pm PST
|
||||
static NetClock::time_point const soTime{542595600s};
|
||||
|
||||
return soTime;
|
||||
}
|
||||
|
||||
bool amendmentRIPD1443 (NetClock::time_point const closeTime)
|
||||
{
|
||||
return closeTime > amendmentRIPD1443SoTime();
|
||||
}
|
||||
|
||||
// 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