mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Review feedback from @gregtatcam
- No need to subtract takeFromSender in rippleSendMultiMPT if the sender is the issuer.
This commit is contained in:
@@ -2621,12 +2621,16 @@ rippleSendMultiMPT(
|
|||||||
// not exceed MaximumAmount
|
// not exceed MaximumAmount
|
||||||
if (senderID == issuer)
|
if (senderID == issuer)
|
||||||
{
|
{
|
||||||
|
XRPL_ASSERT_PARTS(
|
||||||
|
takeFromSender == beast::zero,
|
||||||
|
"rippler::rippleSendMultiMPT",
|
||||||
|
"sender == issuer, takeFromSender == zero");
|
||||||
auto const sendAmount = amount.mpt().value();
|
auto const sendAmount = amount.mpt().value();
|
||||||
auto const maximumAmount =
|
auto const maximumAmount =
|
||||||
sle->at(~sfMaximumAmount).value_or(maxMPTokenAmount);
|
sle->at(~sfMaximumAmount).value_or(maxMPTokenAmount);
|
||||||
if (sendAmount > maximumAmount - takeFromSender ||
|
if (sendAmount > maximumAmount ||
|
||||||
sle->getFieldU64(sfOutstandingAmount) >
|
sle->getFieldU64(sfOutstandingAmount) >
|
||||||
maximumAmount - sendAmount - takeFromSender)
|
maximumAmount - sendAmount)
|
||||||
return tecPATH_DRY;
|
return tecPATH_DRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user