From 3dbecb02eee24d70e12e70f0257a5dd2a3202678 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Fri, 22 Aug 2025 18:29:39 -0400 Subject: [PATCH] Fix subaddress spend detection --- src/backend.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backend.cpp b/src/backend.cpp index eacc35b..12ab0ea 100644 --- a/src/backend.cpp +++ b/src/backend.cpp @@ -410,11 +410,18 @@ namespace lwsf { namespace internal { namespace backend crypto::key_derivation derivation{}; if (!crypto::generate_key_derivation(spend.tx_pub_key, self.view.sec, derivation)) continue; - crypto::public_key output_pub{}; - if (!crypto::derive_public_key(derivation, spend.out_index, self.spend.pub, output_pub)) + + crypto::public_key spend_pub{}; + const crypto::secret_key spend_sec = get_spend_secret(self, spend.sender); + if (!crypto::secret_key_to_public_key(spend_sec, spend_pub)) continue; + + crypto::public_key output_pub{}; + if (!crypto::derive_public_key(derivation, spend.out_index, spend_pub, output_pub)) + continue; + crypto::secret_key output_secret{}; - crypto::derive_secret_key(derivation, spend.out_index, get_spend_secret(self, spend.sender), output_secret); + crypto::derive_secret_key(derivation, spend.out_index, spend_sec, output_secret); crypto::key_image image{}; crypto::generate_key_image(output_pub, output_secret, image);