mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-15 08:35:51 +00:00
Merge master (0.60.2) into develop (0.70.0-b2)
This commit is contained in:
@@ -595,6 +595,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)
|
||||
@@ -605,8 +606,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;
|
||||
@@ -643,6 +642,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.
|
||||
|
||||
@@ -317,7 +317,7 @@ escrow (AccountID const& source, std::uint32_t seq)
|
||||
{
|
||||
sha512_half_hasher h;
|
||||
using beast::hash_append;
|
||||
hash_append(h, spaceEscrow);
|
||||
hash_append(h, std::uint16_t(spaceEscrow));
|
||||
hash_append(h, source);
|
||||
hash_append(h, seq);
|
||||
return { ltESCROW, static_cast<uint256>(h) };
|
||||
@@ -328,7 +328,7 @@ payChan (AccountID const& source, AccountID const& dst, std::uint32_t seq)
|
||||
{
|
||||
sha512_half_hasher h;
|
||||
using beast::hash_append;
|
||||
hash_append(h, spaceXRPUChannel);
|
||||
hash_append(h, std::uint16_t(spaceXRPUChannel));
|
||||
hash_append(h, source);
|
||||
hash_append(h, dst);
|
||||
hash_append(h, seq);
|
||||
|
||||
@@ -50,7 +50,6 @@ protected:
|
||||
|
||||
boost::asio::io_service::work work_;
|
||||
boost::asio::io_service::strand strand_;
|
||||
error_code ec_;
|
||||
|
||||
public:
|
||||
BasePeer(Port const& port, Handler& handler,
|
||||
@@ -61,11 +60,6 @@ public:
|
||||
void
|
||||
close() override;
|
||||
|
||||
protected:
|
||||
template<class String>
|
||||
void
|
||||
fail(error_code ec, String const& what);
|
||||
|
||||
private:
|
||||
Impl&
|
||||
impl()
|
||||
@@ -109,23 +103,6 @@ close()
|
||||
impl().ws_.lowest_layer().close(ec);
|
||||
}
|
||||
|
||||
template<class Handler, class Impl>
|
||||
template<class String>
|
||||
void
|
||||
BasePeer<Handler, Impl>::
|
||||
fail(error_code ec, String const& what)
|
||||
{
|
||||
assert(strand_.running_in_this_thread());
|
||||
if(! ec_ &&
|
||||
ec != boost::asio::error::operation_aborted)
|
||||
{
|
||||
ec_ = ec;
|
||||
JLOG(j_.trace()) <<
|
||||
what << ": " << ec.message();
|
||||
impl().ws_.lowest_layer().close(ec);
|
||||
}
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,15 +42,8 @@ protected:
|
||||
using error_code = boost::system::error_code;
|
||||
using endpoint_type = boost::asio::ip::tcp::endpoint;
|
||||
using waitable_timer = boost::asio::basic_waitable_timer <clock_type>;
|
||||
using BasePeer<Handler, Impl>::fail;
|
||||
using BasePeer<Handler, Impl>::strand_;
|
||||
|
||||
enum
|
||||
{
|
||||
// Max seconds without completing a message
|
||||
timeoutSeconds = 30
|
||||
};
|
||||
|
||||
private:
|
||||
friend class BasePeer<Handler, Impl>;
|
||||
|
||||
@@ -65,6 +58,7 @@ private:
|
||||
bool close_on_timer_ = false;
|
||||
bool ping_active_ = false;
|
||||
beast::websocket::ping_data payload_;
|
||||
error_code ec_;
|
||||
|
||||
public:
|
||||
template<class Body, class Headers>
|
||||
@@ -172,6 +166,10 @@ protected:
|
||||
|
||||
void
|
||||
on_timer(error_code ec);
|
||||
|
||||
template<class String>
|
||||
void
|
||||
fail(error_code ec, String const& what);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -447,9 +445,10 @@ on_timer(error_code ec)
|
||||
return;
|
||||
if(! ec)
|
||||
{
|
||||
if(! close_on_timer_ || !ping_active_)
|
||||
if(! close_on_timer_ || ! ping_active_)
|
||||
{
|
||||
start_timer();
|
||||
close_on_timer_ = true;
|
||||
ping_active_ = true;
|
||||
// cryptographic is probably overkill..
|
||||
beast::rngfill(payload_.begin(),
|
||||
@@ -460,7 +459,7 @@ on_timer(error_code ec)
|
||||
impl().shared_from_this(),
|
||||
std::placeholders::_1)));
|
||||
JLOG(this->j_.trace()) <<
|
||||
"sent pong";
|
||||
"sent ping";
|
||||
return;
|
||||
}
|
||||
ec = boost::system::errc::make_error_code(
|
||||
@@ -469,6 +468,25 @@ on_timer(error_code ec)
|
||||
fail(ec, "timer");
|
||||
}
|
||||
|
||||
template<class Handler, class Impl>
|
||||
template<class String>
|
||||
void
|
||||
BaseWSPeer<Handler, Impl>::
|
||||
fail(error_code ec, String const& what)
|
||||
{
|
||||
assert(strand_.running_in_this_thread());
|
||||
|
||||
cancel_timer();
|
||||
if(! ec_ &&
|
||||
ec != boost::asio::error::operation_aborted)
|
||||
{
|
||||
ec_ = ec;
|
||||
JLOG(this->j_.trace()) <<
|
||||
what << ": " << ec.message();
|
||||
impl().ws_.lowest_layer().close(ec);
|
||||
}
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user