Skip to content

Commit

Permalink
Move requireAuth call
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Jan 8, 2024
1 parent 78a6a93 commit f8d0795
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/ripple/app/tx/impl/Payment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ Payment::doApply()
}
else if (saDstAmount.isMPT())
{
if (auto const ter = requireAuth(view(), saDstAmount.issue(), account_);
ter != tesSUCCESS)
return ter;

if (auto const ter = requireAuth(view(), saDstAmount.issue(), uDstAccountID);
ter != tesSUCCESS)
return ter;

PaymentSandbox pv(&view());
auto const res =
rippleMPTCredit(pv, account_, uDstAccountID, saDstAmount, j_);
Expand Down
8 changes: 0 additions & 8 deletions src/ripple/ledger/impl/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,14 +1718,6 @@ rippleMPTCredit(
STAmount saAmount,
beast::Journal j)
{
if (auto const ter = requireAuth(view, saAmount.issue(), uSenderID);
ter != tesSUCCESS)
return ter;

if (auto const ter = requireAuth(view, saAmount.issue(), uReceiverID);
ter != tesSUCCESS)
return ter;

auto const mptID = keylet::mptIssuance(saAmount.getAsset());
if (uSenderID == saAmount.getIssuer())
{
Expand Down

0 comments on commit f8d0795

Please sign in to comment.