From e93a44fe9bd44f3b4d6b886831b0cc7f061e9cbf Mon Sep 17 00:00:00 2001 From: Scott Schurr Date: Thu, 27 Feb 2020 14:12:13 -0800 Subject: [PATCH] Remove conditionals for fix1368 enabled 31Mar2017 --- src/ripple/ledger/impl/PaymentSandbox.cpp | 15 +++++---------- src/ripple/protocol/Feature.h | 2 +- src/ripple/protocol/impl/Feature.cpp | 2 +- src/test/app/Flow_test.cpp | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/ripple/ledger/impl/PaymentSandbox.cpp b/src/ripple/ledger/impl/PaymentSandbox.cpp index f2c578184..6339cd75f 100644 --- a/src/ripple/ledger/impl/PaymentSandbox.cpp +++ b/src/ripple/ledger/impl/PaymentSandbox.cpp @@ -180,7 +180,6 @@ PaymentSandbox::balanceHook (AccountID const& account, auto const currency = amount.getCurrency (); - auto adjustedAmt = amount; auto delta = amount.zeroed (); auto lastBal = amount; auto minBal = amount; @@ -194,16 +193,12 @@ PaymentSandbox::balanceHook (AccountID const& account, minBal = lastBal; } } - adjustedAmt = std::min(amount, lastBal - delta); - if (rules().enabled(fix1368)) - { - // The adjusted amount should never be larger than the balance. In - // some circumstances, it is possible for the deferred credits table - // to compute usable balance just slightly above what the ledger - // calculates (but always less than the actual balance). - adjustedAmt = std::min(adjustedAmt, minBal); - } + // The adjusted amount should never be larger than the balance. In + // some circumstances, it is possible for the deferred credits table + // to compute usable balance just slightly above what the ledger + // calculates (but always less than the actual balance). + auto adjustedAmt = std::min({amount, lastBal - delta, minBal}); adjustedAmt.setIssuer(amount.getIssuer()); if (isXRP(issuer) && adjustedAmt < beast::zero) diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index f44f7254d..4da45fa99 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -371,7 +371,7 @@ extern uint256 const featureCompareTakerFlowCross; extern uint256 const featureFlowCross; extern uint256 const retiredCryptoConditions; extern uint256 const retiredTickSize; -extern uint256 const fix1368; +extern uint256 const retiredFix1368; extern uint256 const featureEscrow; extern uint256 const featureCryptoConditionsSuite; extern uint256 const fix1373; diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 96340445a..396a8a181 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -162,7 +162,7 @@ uint256 const featureCompareTakerFlowCross = *getRegisteredFeature("CompareTaker uint256 const featureFlowCross = *getRegisteredFeature("FlowCross"); uint256 const retiredCryptoConditions = *getRegisteredFeature("CryptoConditions"); uint256 const retiredTickSize = *getRegisteredFeature("TickSize"); -uint256 const fix1368 = *getRegisteredFeature("fix1368"); +uint256 const retiredFix1368 = *getRegisteredFeature("fix1368"); uint256 const featureEscrow = *getRegisteredFeature("Escrow"); uint256 const featureCryptoConditionsSuite = *getRegisteredFeature("CryptoConditionsSuite"); uint256 const fix1373 = *getRegisteredFeature("fix1373"); diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index bfd1460b4..31e73ac7a 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -1291,7 +1291,7 @@ struct Flow_test : public beast::unit_test::suite testSelfFundedXRPEndpoint(false, features); testSelfFundedXRPEndpoint(true, features); testUnfundedOffer(features); - testReexecuteDirectStep(features | fix1368); + testReexecuteDirectStep(features); testSelfPayLowQualityOffer(features); }