From 25e4559f76801e02338162dbd1b0fa4d45503726 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Tue, 19 Aug 2025 20:17:47 -0400 Subject: [PATCH] Fix tx construction bug in attempts check --- src/wallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 9386bc0..b43749e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1780,7 +1780,8 @@ namespace lwsf { namespace internal const auto unspent_by_amount = get_unspent_by_amount(unspent); unsigned attempt = 0; - for (; attempt < unspent.size(); ++attempt) + const std::size_t max_attempts = unspent.size(); + for (; attempt < max_attempts; ++attempt) { try { @@ -1797,7 +1798,7 @@ namespace lwsf { namespace internal } } - if (attempt == unspent.size()) + if (attempt == max_attempts) throw_low_funds(); }