Autobridging:

Complete implementation of bridged offers crossings. While processing an offer
A:B we consider both the A:B order book and the combined A:XRP and XRP:B books
and pick the better offers. The net result is better liquidity and potentially
better rates.

* Rearchitect core::Taker to perform direct and bridged crossings.
* Compute bridged qualities.
* Implement a new Bridged OfferCreate transactor.
* Factor out common code from the Bridged and Direct OfferCreate transactors.
* Perform flow calculations without losing accuracy.
* Rename all transactors.
* Cleanups.
This commit is contained in:
Nik Bougalis
2014-05-16 14:47:12 -07:00
committed by Vinnie Falco
parent 72bc4ebf37
commit 27e8d44a56
43 changed files with 8631 additions and 8246 deletions

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_TYPES_RIPPLEASSETS_H_INCLUDED
#define RIPPLE_TYPES_RIPPLEASSETS_H_INCLUDED
#include <cassert>
#include <functional>
#include <type_traits>
@@ -66,6 +67,9 @@ public:
: currency (currency_)
, issuer (issuer_)
{
// Either XRP and (currency == zero && issuer == zero) or some custom
// currency and (currency != 0 && issuer != 0)
assert (currency.isZero () == issuer.isZero ());
}
template <bool OtherByValue>
@@ -87,6 +91,7 @@ public:
bool is_xrp () const
{
assert (currency.isZero () == issuer.isZero ());
if (currency.isZero ())
return true;
return false;