guard changes with HooksUpdate1 amendment

This commit is contained in:
Richard Holland
2023-07-12 08:13:34 +00:00
parent 152780b218
commit 4ae13f2bea
2 changed files with 12 additions and 6 deletions

View File

@@ -1824,7 +1824,7 @@ finalizeHookResult(
}
// if any txns were emitted then add them to the HookEmissions
if (!emission_txnid.empty())
if (applyCtx.view().rules().enabled(featureHooksUpdate1) && !emission_txnid.empty())
{
for (auto const& etxnid : emission_txnid)
{

View File

@@ -126,6 +126,9 @@ Import::preflight(PreflightContext const& ctx)
if (!ctx.rules.enabled(featureImport))
return temDISABLED;
if (!ctx.rules.enabled(featureHooksUpdate1) && ctx.tx.isFieldPresent(sfIssuer))
return temDISABLED;
if (auto const ret = preflight1(ctx); !isTesSuccess(ret))
return ret;
@@ -1164,11 +1167,14 @@ Import::doApply()
XRPAmount
Import::calculateBaseFee(ReadView const& view, STTx const& tx)
{
return
!view.exists(keylet::account(tx.getAccountID(sfAccount))) &&
!tx.isFieldPresent(sfIssuer)
? XRPAmount { 0 }
: Transactor::calculateBaseFee(view, tx);
if (!view.rules().enabled(featureHooksUpdate1))
return XRPAmount { 0 };
if (!view.exists(keylet::account(tx.getAccountID(sfAccount))) &&
!tx.isFieldPresent(sfIssuer))
return XRPAmount { 0 };
return Transactor::calculateBaseFee(view, tx);
}
} // namespace ripple