From a5185890ff60a7e98598b05ce41e8111dea09e52 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 17 Mar 2026 14:13:08 -0400 Subject: [PATCH] refactor: Remove dead code in escrow helper logic (#6553) --- src/libxrpl/tx/transactors/escrow/EscrowHelpers.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h b/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h index ccbfff9657..3519471272 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h +++ b/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h @@ -42,7 +42,6 @@ escrowUnlockApplyHelper( bool const recvLow = issuer > receiver; bool const senderIssuer = issuer == sender; bool const receiverIssuer = issuer == receiver; - bool const issuerHigh = issuer > receiver; if (senderIssuer) return tecINTERNAL; // LCOV_EXCL_LINE @@ -50,7 +49,7 @@ escrowUnlockApplyHelper( if (receiverIssuer) return tesSUCCESS; - if (!view.exists(trustLineKey) && createAsset && !receiverIssuer) + if (!view.exists(trustLineKey) && createAsset) { // Can the account cover the trust line's reserve? if (std::uint32_t const ownerCount = {sleDest->at(sfOwnerCount)}; @@ -129,12 +128,12 @@ escrowUnlockApplyHelper( // if the issuer is the high, then we use the low limit // otherwise we use the high limit STAmount const lineLimit = - sleRippleState->getFieldAmount(issuerHigh ? sfLowLimit : sfHighLimit); + sleRippleState->getFieldAmount(recvLow ? sfLowLimit : sfHighLimit); STAmount lineBalance = sleRippleState->getFieldAmount(sfBalance); // flip the sign of the line balance if the issuer is not high - if (!issuerHigh) + if (!recvLow) lineBalance.negate(); // add the final amount to the line balance