From 446f9fbe6d2c7ba6602c11cec42e7beb2accf581 Mon Sep 17 00:00:00 2001 From: Shawn Xie <35279399+shawnxie999@users.noreply.github.com> Date: Mon, 26 Jan 2026 13:04:02 -0500 Subject: [PATCH] Reuse `getConfidentialRecipientCount` (#6281) --- src/test/jtx/impl/mpt.cpp | 3 ++- src/xrpld/app/tx/detail/ConfidentialSend.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/jtx/impl/mpt.cpp b/src/test/jtx/impl/mpt.cpp index 884af1606b..267d71e3f3 100644 --- a/src/test/jtx/impl/mpt.cpp +++ b/src/test/jtx/impl/mpt.cpp @@ -1277,7 +1277,8 @@ MPTTester::send(MPTConfidentialSend const& arg) arg.dest->id(), version); - auto const nRecipients = auditorAmt ? 4 : 3; + auto const nRecipients = + getConfidentialRecipientCount(auditorAmt.has_value()); std::vector recipients; auto const senderPubKey = getPubKey(*arg.account); diff --git a/src/xrpld/app/tx/detail/ConfidentialSend.cpp b/src/xrpld/app/tx/detail/ConfidentialSend.cpp index 2996d13606..5b65883365 100644 --- a/src/xrpld/app/tx/detail/ConfidentialSend.cpp +++ b/src/xrpld/app/tx/detail/ConfidentialSend.cpp @@ -162,7 +162,8 @@ ConfidentialSend::preclaim(PreclaimContext const& ctx) destination, (*sleSenderMPToken)[~sfConfidentialBalanceVersion].value_or(0)); - auto const expectedRecipients = requiresAuditor ? 4 : 3; + auto const expectedRecipients = + getConfidentialRecipientCount(requiresAuditor); // Prepare encrypted amount info for proof verification std::vector recipients;