From 24ae843b07d29ce86f34739c8e1e4957d8229bbb Mon Sep 17 00:00:00 2001 From: JCW Date: Tue, 14 Jul 2026 14:02:54 +0100 Subject: [PATCH 1/2] Clean up the code --- include/xrpl/tx/transactors/lending/LoanSet.h | 5 ---- .../tx/transactors/lending/LoanSet.cpp | 25 +------------------ 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/include/xrpl/tx/transactors/lending/LoanSet.h b/include/xrpl/tx/transactors/lending/LoanSet.h index 5cfd6c7988..fab489e3db 100644 --- a/include/xrpl/tx/transactors/lending/LoanSet.h +++ b/include/xrpl/tx/transactors/lending/LoanSet.h @@ -18,11 +18,6 @@ namespace xrpl { class LoanSet : public Transactor { -private: - /* Returns true if the transaction is using the two-step (Borrower) flow. */ - static bool - isTwoStepFlow(STTx const& tx, Rules const& rules); - public: static constexpr auto kConsequencesFactory = ConsequencesFactoryType::Normal; diff --git a/src/libxrpl/tx/transactors/lending/LoanSet.cpp b/src/libxrpl/tx/transactors/lending/LoanSet.cpp index ee86ae3e3d..1ac387d1b1 100644 --- a/src/libxrpl/tx/transactors/lending/LoanSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanSet.cpp @@ -49,19 +49,6 @@ LoanSet::getFlagsMask(PreflightContext const& ctx) return tfLoanSetMask; } -bool -LoanSet::isTwoStepFlow(STTx const& tx, Rules const& rules) -{ - if (!rules.enabled(featureLendingProtocolV1_1)) - return false; - - // The two-step (Borrower) flow is started when the LoanSet names a - // Borrower and a StartDate but carries neither a Counterparty nor a - // CounterpartySignature. - return tx.isFieldPresent(sfBorrower) && tx.isFieldPresent(sfStartDate) && - !tx.isFieldPresent(sfCounterparty) && !tx.isFieldPresent(sfCounterpartySignature); -} - NotTEC LoanSet::preflight(PreflightContext const& ctx) { @@ -85,12 +72,7 @@ LoanSet::preflight(PreflightContext const& ctx) return tx.getFieldObject(sfCounterpartySignature); return std::nullopt; }(); - - bool twoStepFlow = isTwoStepFlow(tx, ctx.rules); - // In the two-step (Borrower) flow introduced by V1.1, a CounterpartySignature - // is not required even for non-batch transactions. The immediate flow still - // requires one. - if (!tx.isFlag(tfInnerBatchTxn) && !counterPartySig && !twoStepFlow) + if (!tx.isFlag(tfInnerBatchTxn) && !counterPartySig) { JLOG(ctx.j.warn()) << "LoanSet transaction must have a CounterpartySignature."; return temBAD_SIGNER; @@ -161,11 +143,6 @@ LoanSet::checkSign(PreclaimContext const& ctx) if (auto ret = Transactor::checkSign(ctx)) return ret; - // In the two-step (Borrower) flow introduced by V1.1 there is no - // counterparty, so there is no CounterpartySignature to check. - if (isTwoStepFlow(ctx.tx, ctx.view.rules())) - return tesSUCCESS; - // Counter signer is optional. If it's not specified, it's assumed to be // `LoanBroker.Owner`. Note that we have not checked whether the // loanbroker exists at this point. From d02cfcdef477173d18e5813398461b5e434bc6c7 Mon Sep 17 00:00:00 2001 From: Jingchen Date: Tue, 14 Jul 2026 14:43:06 +0100 Subject: [PATCH 2/2] Update src/libxrpl/tx/invariants/VaultInvariant.cpp Co-authored-by: depthfirst-app[bot] <184448029+depthfirst-app[bot]@users.noreply.github.com> --- src/libxrpl/tx/invariants/VaultInvariant.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libxrpl/tx/invariants/VaultInvariant.cpp b/src/libxrpl/tx/invariants/VaultInvariant.cpp index e9306b7e4d..0a66d5af5f 100644 --- a/src/libxrpl/tx/invariants/VaultInvariant.cpp +++ b/src/libxrpl/tx/invariants/VaultInvariant.cpp @@ -484,7 +484,6 @@ ValidVault::finalize( tx.isFieldPresent(sfStartDate) && !tx.isFieldPresent(sfCounterpartySignature) && !tx.isFieldPresent(sfCounterparty); - !tx.isFieldPresent(sfCounterpartySignature); if (txnType != ttLOAN_DELETE && txnType != ttLOAN_ACCEPT && !pendingLoanSet) { JLOG(j.fatal()) << "Invariant failed: vault AssetsReserved changed "