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

@@ -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&)