page cap fix

This commit is contained in:
Richard Holland
2024-09-05 23:33:23 +10:00
parent 833df20fce
commit faebfce3ed
3 changed files with 7 additions and 3 deletions

View File

@@ -91,9 +91,11 @@ ApplyView::dirAdd(
return page;
}
bool const capped = !rules().enabled(fixPageCap);
// Check whether we're out of pages.
if (++page >= dirNodeMaxPages)
return std::nullopt;
if (++page >= dirNodeMaxPages && capped)
return std::nullopt;
// We are about to create a new node; we'll link it to
// the chain first:

View File

@@ -74,7 +74,7 @@ namespace detail {
// Feature.cpp. Because it's only used to reserve storage, and determine how
// large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than
// the actual number of amendments. A LogicError on startup will verify this.
static constexpr std::size_t numFeatures = 71;
static constexpr std::size_t numFeatures = 72;
/** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated
@@ -359,6 +359,7 @@ extern uint256 const featureRemit;
extern uint256 const featureZeroB2M;
extern uint256 const fixNSDelete;
extern uint256 const fix240819;
extern uint256 const fixPageCap;
} // namespace ripple

View File

@@ -465,6 +465,7 @@ REGISTER_FEATURE(Remit, Supported::yes, VoteBehavior::De
REGISTER_FEATURE(ZeroB2M, Supported::yes, VoteBehavior::DefaultNo);
REGISTER_FIX (fixNSDelete, Supported::yes, VoteBehavior::DefaultNo);
REGISTER_FIX (fix240819, Supported::yes, VoteBehavior::DefaultYes);
REGISTER_FIX (fixPageCap, Supported::yes, VoteBehavior::DefaultYes);
// The following amendments are obsolete, but must remain supported
// because they could potentially get enabled.