mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-31 19:10:25 +00:00
Return unfunded and expired offers when flow fails:
Payments do not remove unfunded and expired offers when a payment fails. However, offer crossing is now using the payment engine and needs to know what offers were found in a removable state, even on failure.
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <ripple/protocol/IOUAmount.h>
|
||||
#include <ripple/protocol/Quality.h>
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
||||
#include <numeric>
|
||||
#include <sstream>
|
||||
|
||||
@@ -111,14 +113,14 @@ class DirectStepI : public StepImp<IOUAmount, IOUAmount, DirectStepI>
|
||||
revImp (
|
||||
PaymentSandbox& sb,
|
||||
ApplyView& afView,
|
||||
std::vector<uint256>& ofrsToRm,
|
||||
boost::container::flat_set<uint256>& ofrsToRm,
|
||||
IOUAmount const& out);
|
||||
|
||||
std::pair<IOUAmount, IOUAmount>
|
||||
fwdImp (
|
||||
PaymentSandbox& sb,
|
||||
ApplyView& afView,
|
||||
std::vector<uint256>& ofrsToRm,
|
||||
boost::container::flat_set<uint256>& ofrsToRm,
|
||||
IOUAmount const& in);
|
||||
|
||||
std::pair<bool, EitherAmount>
|
||||
@@ -195,7 +197,7 @@ std::pair<IOUAmount, IOUAmount>
|
||||
DirectStepI::revImp (
|
||||
PaymentSandbox& sb,
|
||||
ApplyView& /*afView*/,
|
||||
std::vector<uint256>& /*ofrsToRm*/,
|
||||
boost::container::flat_set<uint256>& /*ofrsToRm*/,
|
||||
IOUAmount const& out)
|
||||
{
|
||||
cache_.reset ();
|
||||
@@ -313,7 +315,7 @@ std::pair<IOUAmount, IOUAmount>
|
||||
DirectStepI::fwdImp (
|
||||
PaymentSandbox& sb,
|
||||
ApplyView& /*afView*/,
|
||||
std::vector<uint256>& /*ofrsToRm*/,
|
||||
boost::container::flat_set<uint256>& /*ofrsToRm*/,
|
||||
IOUAmount const& in)
|
||||
{
|
||||
assert (cache_);
|
||||
@@ -409,7 +411,7 @@ DirectStepI::validFwd (
|
||||
|
||||
try
|
||||
{
|
||||
std::vector<uint256> dummy;
|
||||
boost::container::flat_set<uint256> dummy;
|
||||
fwdImp (sb, afView, dummy, in.iou); // changes cache
|
||||
}
|
||||
catch (FlowException const&)
|
||||
|
||||
Reference in New Issue
Block a user