mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Rm some offers where the quality is reduced:
Substantial reductions in an offer's effective quality from its initial quality may clog offer books.
This commit is contained in:
@@ -63,11 +63,7 @@ toSTAmount(XRPAmount const& xrp, Issue const& iss)
|
||||
|
||||
template <class T>
|
||||
T
|
||||
toAmount(STAmount const& amt)
|
||||
{
|
||||
static_assert(sizeof(T) == -1, "Must use specialized function");
|
||||
return T(0);
|
||||
}
|
||||
toAmount(STAmount const& amt) = delete;
|
||||
|
||||
template <>
|
||||
inline STAmount
|
||||
@@ -102,6 +98,28 @@ toAmount<XRPAmount>(STAmount const& amt)
|
||||
return XRPAmount(sMant);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T
|
||||
toAmount(IOUAmount const& amt) = delete;
|
||||
|
||||
template <>
|
||||
inline IOUAmount
|
||||
toAmount<IOUAmount>(IOUAmount const& amt)
|
||||
{
|
||||
return amt;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T
|
||||
toAmount(XRPAmount const& amt) = delete;
|
||||
|
||||
template <>
|
||||
inline XRPAmount
|
||||
toAmount<XRPAmount>(XRPAmount const& amt)
|
||||
{
|
||||
return amt;
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,6 +116,7 @@ class FeatureCollections
|
||||
"TicketBatch",
|
||||
"FlowSortStrands",
|
||||
"fixSTAmountCanonicalize",
|
||||
"fixRmSmallIncreasedQOffers",
|
||||
};
|
||||
|
||||
std::vector<uint256> features;
|
||||
@@ -376,6 +377,7 @@ extern uint256 const featureNegativeUNL;
|
||||
extern uint256 const featureTicketBatch;
|
||||
extern uint256 const featureFlowSortStrands;
|
||||
extern uint256 const fixSTAmountCanonicalize;
|
||||
extern uint256 const fixRmSmallIncreasedQOffers;
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
|
||||
@@ -132,6 +132,13 @@ public:
|
||||
/** Create a quality from the ratio of two amounts. */
|
||||
explicit Quality(Amounts const& amount);
|
||||
|
||||
/** Create a quality from the ratio of two amounts. */
|
||||
template <class In, class Out>
|
||||
Quality(TAmounts<In, Out> const& amount)
|
||||
: Quality(Amounts(toSTAmount(amount.in), toSTAmount(amount.out)))
|
||||
{
|
||||
}
|
||||
|
||||
/** Create a quality from the ratio of two amounts. */
|
||||
template <class In, class Out>
|
||||
Quality(Out const& out, In const& in)
|
||||
|
||||
@@ -135,6 +135,7 @@ detail::supportedAmendments()
|
||||
"TicketBatch",
|
||||
"FlowSortStrands",
|
||||
"fixSTAmountCanonicalize",
|
||||
"fixRmSmallIncreasedQOffers",
|
||||
};
|
||||
return supported;
|
||||
}
|
||||
@@ -190,7 +191,8 @@ uint256 const
|
||||
featureNegativeUNL = *getRegisteredFeature("NegativeUNL"),
|
||||
featureTicketBatch = *getRegisteredFeature("TicketBatch"),
|
||||
featureFlowSortStrands = *getRegisteredFeature("FlowSortStrands"),
|
||||
fixSTAmountCanonicalize = *getRegisteredFeature("fixSTAmountCanonicalize");
|
||||
fixSTAmountCanonicalize = *getRegisteredFeature("fixSTAmountCanonicalize"),
|
||||
fixRmSmallIncreasedQOffers = *getRegisteredFeature("fixRmSmallIncreasedQOffers");
|
||||
|
||||
// The following amendments have been active for at least two years. Their
|
||||
// pre-amendment code has been removed and the identifiers are deprecated.
|
||||
|
||||
Reference in New Issue
Block a user