From f8d0795e401dc1f90e8c7cd4d072e68bad57b84a Mon Sep 17 00:00:00 2001 From: Shawn Xie Date: Mon, 8 Jan 2024 15:06:02 -0500 Subject: [PATCH] Move requireAuth call --- src/ripple/app/tx/impl/Payment.cpp | 8 ++++++++ src/ripple/ledger/impl/View.cpp | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ripple/app/tx/impl/Payment.cpp b/src/ripple/app/tx/impl/Payment.cpp index 10b69fd582d..d41422203c7 100644 --- a/src/ripple/app/tx/impl/Payment.cpp +++ b/src/ripple/app/tx/impl/Payment.cpp @@ -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_); diff --git a/src/ripple/ledger/impl/View.cpp b/src/ripple/ledger/impl/View.cpp index 521207c76b4..a24d1dda016 100644 --- a/src/ripple/ledger/impl/View.cpp +++ b/src/ripple/ledger/impl/View.cpp @@ -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()) {