mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 02:25:52 +00:00
Merge branch 'ximinez/lending-refactoring-3' into ximinez/lending-refactoring-4
This commit is contained in:
@@ -56,9 +56,12 @@ CreateOffer::checkExtraFeatures(PreflightContext const& ctx)
|
||||
std::uint32_t
|
||||
CreateOffer::getFlagsMask(PreflightContext const& ctx)
|
||||
{
|
||||
if (ctx.rules.enabled(featurePermissionedDEX) &&
|
||||
ctx.tx.isFieldPresent(sfDomainID))
|
||||
// The tfOfferCreateMask is built assuming that PermissionedDEX is
|
||||
// enabled
|
||||
if (ctx.rules.enabled(featurePermissionedDEX))
|
||||
return tfOfferCreateMask;
|
||||
// If PermissionedDEX is not enabled, add tfHybrid to the mask,
|
||||
// indicating it is not allowed.
|
||||
return tfOfferCreateMask | tfHybrid;
|
||||
}
|
||||
|
||||
@@ -70,6 +73,9 @@ CreateOffer::preflight(PreflightContext const& ctx)
|
||||
|
||||
std::uint32_t const uTxFlags = tx.getFlags();
|
||||
|
||||
if (tx.isFlag(tfHybrid) && !tx.isFieldPresent(sfDomainID))
|
||||
return temINVALID_FLAG;
|
||||
|
||||
bool const bImmediateOrCancel(uTxFlags & tfImmediateOrCancel);
|
||||
bool const bFillOrKill(uTxFlags & tfFillOrKill);
|
||||
|
||||
|
||||
@@ -44,8 +44,11 @@ DeleteAccount::checkExtraFeatures(PreflightContext const& ctx)
|
||||
if (!ctx.rules.enabled(featureDeletableAccounts))
|
||||
return false;
|
||||
|
||||
return !ctx.tx.isFieldPresent(sfCredentialIDs) ||
|
||||
ctx.rules.enabled(featureCredentials);
|
||||
if (ctx.tx.isFieldPresent(sfCredentialIDs) &&
|
||||
!ctx.rules.enabled(featureCredentials))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NotTEC
|
||||
|
||||
@@ -36,10 +36,12 @@ DepositPreauth::checkExtraFeatures(PreflightContext const& ctx)
|
||||
bool const authArrPresent = ctx.tx.isFieldPresent(sfAuthorizeCredentials);
|
||||
bool const unauthArrPresent =
|
||||
ctx.tx.isFieldPresent(sfUnauthorizeCredentials);
|
||||
int const authCredPresent =
|
||||
static_cast<int>(authArrPresent) + static_cast<int>(unauthArrPresent);
|
||||
bool const authCredPresent = authArrPresent || unauthArrPresent;
|
||||
|
||||
return !authCredPresent || ctx.rules.enabled(featureCredentials);
|
||||
if (authCredPresent && !ctx.rules.enabled(featureCredentials))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NotTEC
|
||||
|
||||
Reference in New Issue
Block a user