Improve canonicalization of serialized amounts:

The existing code that deserialized an STAmount was sub-optimal and performed
poorly. In some rare cases the operation could result in otherwise valid
serialized amounts overflowing during deserialization. This commit will help
detect error conditions more quickly and eliminate the problematic corner cases.
This commit is contained in:
seelabs
2020-12-01 13:58:36 -05:00
committed by manojsdoshi
parent fe129e8e4f
commit c47b4f3667
7 changed files with 63 additions and 3 deletions

View File

@@ -114,7 +114,9 @@ class FeatureCollections
"fixAmendmentMajorityCalc", // Fix Amendment majority calculation
"NegativeUNL",
"TicketBatch",
"FlowSortStrands"};
"FlowSortStrands",
"fixSTAmountCanonicalize",
};
std::vector<uint256> features;
boost::container::flat_map<uint256, std::size_t> featureToIndex;
@@ -373,6 +375,7 @@ extern uint256 const fixAmendmentMajorityCalc;
extern uint256 const featureNegativeUNL;
extern uint256 const featureTicketBatch;
extern uint256 const featureFlowSortStrands;
extern uint256 const fixSTAmountCanonicalize;
} // namespace ripple