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:
seelabs
2016-03-24 11:08:46 -04:00
committed by Nik Bougalis
parent 968327d577
commit ef3dc5bb58
11 changed files with 229 additions and 127 deletions

View File

@@ -28,6 +28,7 @@
#include <ripple/protocol/Quality.h>
#include <ripple/protocol/XRPAmount.h>
#include <boost/container/flat_set.hpp>
#include <numeric>
#include <sstream>
@@ -83,14 +84,14 @@ class XRPEndpointStep : public StepImp<XRPAmount, XRPAmount, XRPEndpointStep>
revImp (
PaymentSandbox& sb,
ApplyView& afView,
std::vector<uint256>& ofrsToRm,
boost::container::flat_set<uint256>& ofrsToRm,
XRPAmount const& out);
std::pair<XRPAmount, XRPAmount>
fwdImp (
PaymentSandbox& sb,
ApplyView& afView,
std::vector<uint256>& ofrsToRm,
boost::container::flat_set<uint256>& ofrsToRm,
XRPAmount const& in);
std::pair<bool, EitherAmount>
@@ -154,7 +155,7 @@ std::pair<XRPAmount, XRPAmount>
XRPEndpointStep::revImp (
PaymentSandbox& sb,
ApplyView& afView,
std::vector<uint256>& ofrsToRm,
boost::container::flat_set<uint256>& ofrsToRm,
XRPAmount const& out)
{
auto const balance = xrpLiquid (sb, acc_);
@@ -174,7 +175,7 @@ std::pair<XRPAmount, XRPAmount>
XRPEndpointStep::fwdImp (
PaymentSandbox& sb,
ApplyView& afView,
std::vector<uint256>& ofrsToRm,
boost::container::flat_set<uint256>& ofrsToRm,
XRPAmount const& in)
{
assert (cache_);