add assertion to validate transfer fee does not exceed maximum allowed value

This commit is contained in:
Mayukha Vadari
2026-03-18 17:50:04 -04:00
parent 346fbbd3ac
commit 1dcbc503d8

View File

@@ -800,7 +800,11 @@ transferRate(ReadView const& view, MPTID const& issuanceID)
// which represents 50% of 1,000,000,000
if (auto const sle = view.read(keylet::mptIssuance(issuanceID));
sle && sle->isFieldPresent(sfTransferFee))
{
auto const fee = sle->getFieldU16(sfTransferFee);
XRPL_ASSERT(fee <= maxTransferFee, "xrpl::transferRate : fee is too large");
return Rate{1'000'000'000u + 10'000 * sle->getFieldU16(sfTransferFee)};
}
return parityRate;
}