From 05bb41056d6e0db908f2c1c6c895538bdae07e7d Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 23 Jun 2026 15:48:51 -0400 Subject: [PATCH] refactor: rename `STTx::getFeePayer` to `getInitiator` (#7603) --- include/xrpl/protocol/STTx.h | 2 +- src/libxrpl/protocol/STTx.cpp | 4 ++-- src/libxrpl/tx/Transactor.cpp | 2 +- src/libxrpl/tx/transactors/payment/Payment.cpp | 2 +- src/xrpld/rpc/detail/TransactionSign.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/xrpl/protocol/STTx.h b/include/xrpl/protocol/STTx.h index 659fede31d..3aa448d2e7 100644 --- a/include/xrpl/protocol/STTx.h +++ b/include/xrpl/protocol/STTx.h @@ -84,7 +84,7 @@ public: getSeqValue() const; AccountID - getFeePayer() const; + getInitiator() const; boost::container::flat_set getMentionedAccounts() const; diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index 3fa97bda5e..5cf768a05f 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -213,7 +213,7 @@ STTx::getSeqValue() const } AccountID -STTx::getFeePayer() const +STTx::getInitiator() const { // If sfDelegate is present, the delegate account is the payer // note: if a delegate is specified, its authorization to act on behalf of the account is @@ -546,7 +546,7 @@ STTx::checkMultiSign(Rules const& rules, STObject const& sigObject) const // For delegated transactions sfDelegate is the account whose signer list is checked, // the delegate account itself can not be among the signers. auto const txnAccountID = - &sigObject != this ? std::nullopt : std::optional(getFeePayer()); + &sigObject != this ? std::nullopt : std::optional(getInitiator()); // We can ease the computational load inside the loop a bit by // pre-constructing part of the data that we hash. Fill a Serializer diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index ca4926af78..fd9261f1fc 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -1349,7 +1349,7 @@ Transactor::getFeePayer(ReadView const& view, STTx const& tx) .type = FeePayerType::SponsorPreFunded}; } - auto const payerAccountKeylet = keylet::account(tx.getFeePayer()); + auto const payerAccountKeylet = keylet::account(tx.getInitiator()); auto const payerType = tx.isFieldPresent(sfDelegate) ? FeePayerType::Delegate : FeePayerType::Account; diff --git a/src/libxrpl/tx/transactors/payment/Payment.cpp b/src/libxrpl/tx/transactors/payment/Payment.cpp index d8f312c625..6eab8b45c6 100644 --- a/src/libxrpl/tx/transactors/payment/Payment.cpp +++ b/src/libxrpl/tx/transactors/payment/Payment.cpp @@ -640,7 +640,7 @@ Payment::doApply() // In a delegated payment, the fee payer is the delegated account, // not the source account (accountID_). - bool const accountIsPayer = (ctx_.tx.getFeePayer() == accountID_); + bool const accountIsPayer = (ctx_.tx.getInitiator() == accountID_); // preFeeBalance_ is the balance on the source account (accountID_) BEFORE the fees // were charged. If source account is the fee payer, it must also cover the fee. diff --git a/src/xrpld/rpc/detail/TransactionSign.cpp b/src/xrpld/rpc/detail/TransactionSign.cpp index 8c3a5ea245..b8731a2289 100644 --- a/src/xrpld/rpc/detail/TransactionSign.cpp +++ b/src/xrpld/rpc/detail/TransactionSign.cpp @@ -1256,7 +1256,7 @@ transactionSignFor( // The array must be sorted and validated. // For delegated transactions, the delegate account is // the one forbidden from appearing in its own Signers array. - auto err = sortAndValidateSigners(signers, sttx->getFeePayer()); + auto err = sortAndValidateSigners(signers, sttx->getInitiator()); if (RPC::containsError(err)) return err; } @@ -1423,9 +1423,9 @@ transactionSubmitMultiSigned( } // The array must be sorted and validated. - // For delegated transactions, getFeePayer() returns sfDelegate, + // For delegated transactions, getInitiator() returns sfDelegate, // that account is the one forbidden from appearing in its own Signers array. - auto err = sortAndValidateSigners(signers, stTx->getFeePayer()); + auto err = sortAndValidateSigners(signers, stTx->getInitiator()); if (RPC::containsError(err)) return err;