From a3b2ce91defb87b6e870562b27f5b8a37561217c Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Sat, 22 Nov 2025 23:45:39 -0500 Subject: [PATCH] Review feedback from @gregtatcam: frozen broker pseudo-account - LoanSet needs to fail if the broker pseudo-account is deep frozen, because it needs to be able to receive fees if the broker owner can't. --- src/xrpld/app/tx/detail/LoanSet.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/xrpld/app/tx/detail/LoanSet.cpp b/src/xrpld/app/tx/detail/LoanSet.cpp index 6c0ce68386..95cb48234b 100644 --- a/src/xrpld/app/tx/detail/LoanSet.cpp +++ b/src/xrpld/app/tx/detail/LoanSet.cpp @@ -266,6 +266,7 @@ LoanSet::preclaim(PreclaimContext const& ctx) "of the LoanBroker."; return tecNO_PERMISSION; } + auto const brokerPseudo = brokerSle->at(sfAccount); auto const borrower = counterparty == brokerOwner ? account : counterparty; if (auto const borrowerSle = ctx.view.read(keylet::account(borrower)); @@ -312,6 +313,16 @@ LoanSet::preclaim(PreclaimContext const& ctx) JLOG(ctx.j.warn()) << "Vault pseudo-account is frozen."; return ret; } + + // brokerPseudo is the fallback account to receive LoanPay fees, even if the + // broker owner is unable to accept them. Don't create the loan if it is + // deep frozen. + if (auto const ret = checkDeepFrozen(ctx.view, brokerPseudo, asset)) + { + JLOG(ctx.j.warn()) << "Broker pseudo-account is frozen."; + return ret; + } + // borrower is eventually going to have to pay back the loan, so it can't be // frozen now. It is also going to receive funds, so it can't be deep // frozen, but being frozen is a prerequisite for being deep frozen, so