Review feedback from @gregtatcam

- No need to subtract takeFromSender in rippleSendMultiMPT if the sender
  is the issuer.
This commit is contained in:
Ed Hennis
2025-11-22 21:11:06 -05:00
parent b82481858a
commit 4c9a96a17b

View File

@@ -2621,12 +2621,16 @@ rippleSendMultiMPT(
// not exceed MaximumAmount
if (senderID == issuer)
{
XRPL_ASSERT_PARTS(
takeFromSender == beast::zero,
"rippler::rippleSendMultiMPT",
"sender == issuer, takeFromSender == zero");
auto const sendAmount = amount.mpt().value();
auto const maximumAmount =
sle->at(~sfMaximumAmount).value_or(maxMPTokenAmount);
if (sendAmount > maximumAmount - takeFromSender ||
if (sendAmount > maximumAmount ||
sle->getFieldU64(sfOutstandingAmount) >
maximumAmount - sendAmount - takeFromSender)
maximumAmount - sendAmount)
return tecPATH_DRY;
}