diff --git a/include/xrpl/protocol/Rules.h b/include/xrpl/protocol/Rules.h index a7eecf3e54..e431ef0146 100644 --- a/include/xrpl/protocol/Rules.h +++ b/include/xrpl/protocol/Rules.h @@ -35,7 +35,20 @@ namespace ripple { * context. */ bool -isFeatureEnabled(uint256 const& feature, bool resultIfNoRules = false); +isFeatureEnabled(uint256 const& feature, bool resultIfNoRules); + +/** Check whether a feature is enabled in the current ledger rules + * + * @param feature The feature to be tested. + * + * Returns false if no global Rules object is available. i.e. Outside of + * a Transactor context + */ +bool +isFeatureEnabled(uint256 const& feature) +{ + return isFeatureEnabled(feature, false); +} class DigestAwareReadView; diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index b9a86cf98f..35bc79fec8 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -124,7 +124,7 @@ class Invariants_test : public beast::unit_test::suite jlog}; // Invariants normally run in the Transaction's "apply" (operator()) - // context, and can access global Rules. (Not dependent on amendments.) + // context, and can always access global Rules. CurrentTransactionRulesGuard const rg(ov.rules()); BEAST_EXPECT(precheck(A1, A2, ac)); diff --git a/src/xrpld/app/tx/detail/InvariantCheck.cpp b/src/xrpld/app/tx/detail/InvariantCheck.cpp index 72541a620f..ddb8588dcd 100644 --- a/src/xrpld/app/tx/detail/InvariantCheck.cpp +++ b/src/xrpld/app/tx/detail/InvariantCheck.cpp @@ -413,7 +413,6 @@ NoZeroEscrow::visitEntry( if (auto const locked = (*after)[~sfLockedAmount]) { checkAmount(*locked); - bad_ = outstanding < *locked; bool const isBad = outstanding < *locked; if (overwriteFixEnabled) bad_ |= isBad;