diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 7164cd46e4e..4829b1b8f52 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -337,6 +337,7 @@ extern uint256 const featureNonFungibleTokensV1; extern uint256 const featureExpandedSignerList; extern uint256 const fixNFTokenDirV1; extern uint256 const fixNFTokenNegOffer; +extern uint256 const featureNonFungibleTokensV1_1; } // namespace ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 1fcca56e884..4060067e30a 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -441,6 +441,7 @@ REGISTER_FEATURE(NonFungibleTokensV1, Supported::yes, DefaultVote::no) REGISTER_FEATURE(ExpandedSignerList, Supported::yes, DefaultVote::no); REGISTER_FIX (fixNFTokenDirV1, Supported::yes, DefaultVote::no); REGISTER_FIX (fixNFTokenNegOffer, Supported::yes, DefaultVote::no); +REGISTER_FEATURE(NonFungibleTokensV1_1, Supported::yes, DefaultVote::no); // The following amendments have been active for at least two years. Their // pre-amendment code has been removed and the identifiers are deprecated. diff --git a/src/ripple/protocol/impl/Rules.cpp b/src/ripple/protocol/impl/Rules.cpp index 3736764fcf9..9816b2410ce 100644 --- a/src/ripple/protocol/impl/Rules.cpp +++ b/src/ripple/protocol/impl/Rules.cpp @@ -17,10 +17,10 @@ */ //============================================================================== +#include +//#include #include -#include - namespace ripple { class Rules::Impl @@ -40,9 +40,8 @@ class Rules::Impl std::unordered_set> const& presets, std::optional const& digest, STVector256 const& amendments) - : presets_(presets) + : presets_(presets), digest_(digest) { - digest_ = digest; set_.reserve(amendments.size()); set_.insert(amendments.begin(), amendments.end()); } @@ -83,6 +82,18 @@ bool Rules::enabled(uint256 const& feature) const { assert(impl_); + + // The functionality of the "NonFungibleTokensV1_1" amendment is + // precisely the functionality of the following three amendments + // so if their status is ever queried individually, we inject an + // extra check here to simplify the checking elsewhere. + if (feature == featureNonFungibleTokensV1 || + feature == fixNFTokenNegOffer || feature == fixNFTokenDirV1) + { + if (impl_->enabled(featureNonFungibleTokensV1_1)) + return true; + } + return impl_->enabled(feature); }