From e26eab8ca77e750b5d65f4e39eadf71421a83aa7 Mon Sep 17 00:00:00 2001 From: Cole Munz Date: Fri, 31 Jul 2026 23:43:43 -0500 Subject: [PATCH] simplewallet: use the swept account for index=all in sweep_main sweep_main() takes the account to sweep as a parameter, but the index=all expansion still counts subaddresses on m_current_subaddress_account. sweep_all and sweep_below pass the current account, so sweep_account is the one command that ends up with the wrong set. When the current account has fewer subaddresses than the account being swept, the set is too small and outputs in the higher minor indices never make it into the sweep. If none of the target's unlocked outputs land in that range, create_transactions_all throws "No unlocked balance in the specified subaddress(es)" for an account that plainly has a balance. 27d551d12f8d added the account parameter and pointed create_transactions_all at it, but left this loop on the old field. The RPC path already does it the right way, with get_num_subaddresses(req.account_index). --- src/simplewallet/simplewallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 17a9f2b60..0616f1f9d 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -6849,7 +6849,7 @@ bool simple_wallet::sweep_main(uint32_t account, uint64_t below, const std::vect { if (local_args[0] == "index=all") { - for (uint32_t i = 0; i < m_wallet->get_num_subaddresses(m_current_subaddress_account); ++i) + for (uint32_t i = 0; i < m_wallet->get_num_subaddresses(account); ++i) subaddr_indices.insert(i); } else if (!parse_subaddress_indices(local_args[0], subaddr_indices))