From 021bee8dd458571e4c77c1792568b4b83ec972bf Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Tue, 22 Jul 2025 12:10:58 -0400 Subject: [PATCH] fixup! Make preflight1 and preflight2 private static Transactor functions --- src/xrpld/app/tx/detail/Transactor.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 41e8de1c1d..5988199393 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -118,22 +118,23 @@ preflightCheckSimulateKeys( STObject const& sigObject, beast::Journal j) { - if (ctx.flags & tapDRY_RUN) // simulation + if (flags & tapDRY_RUN) // simulation { - if (!ctx.tx.getSignature().empty()) + std::optional const signature = sigObject[~sfTxnSignature]; + if (signature && !signature->empty()) { // NOTE: This code should never be hit because it's checked in the // `simulate` RPC return temINVALID; // LCOV_EXCL_LINE } - if (!ctx.tx.isFieldPresent(sfSigners)) + if (!sigObject.isFieldPresent(sfSigners)) { // no signers, no signature - a valid simulation return tesSUCCESS; } - for (auto const& signer : ctx.tx.getFieldArray(sfSigners)) + for (auto const& signer : sigObject.getFieldArray(sfSigners)) { if (signer.isFieldPresent(sfTxnSignature) && !signer[sfTxnSignature].empty()) @@ -144,7 +145,8 @@ preflightCheckSimulateKeys( } } - if (!ctx.tx.getSigningPubKey().empty()) + Slice const signingPubKey = sigObject[sfSigningPubKey]; + if (!signingPubKey.empty()) { // trying to single-sign _and_ multi-sign a transaction return temINVALID;