From 81bacaf6bbec45c17bdfe5a59c7077eb70ea8982 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sat, 20 Jan 2024 15:49:30 +0100 Subject: [PATCH] and another tweak of decoy selection algo(more clear exit from loop) --- src/currency_core/blockchain_storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index af0675e9..883a65ee 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2700,7 +2700,7 @@ bool blockchain_storage::get_target_outs_for_amount_prezarcanum(const COMMAND_RP std::set used; used.insert(details.own_global_index); size_t try_count = 0; - for (uint64_t j = 0; j != decoys_count && try_count++ < decoys_count+1;) + for (uint64_t j = 0; j != decoys_count || used.size() >= up_index_limit;) { size_t g_index_initial = crypto::rand() % up_index_limit; size_t g_index = g_index_initial;