mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
committed by
Vinnie Falco
parent
72bc4ebf37
commit
27e8d44a56
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user