From d3bb72fff16cd12a41720887dbf576e11ee47f4a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 26 Jun 2017 06:56:44 +0100 Subject: [PATCH] wallet2: fix infinite loop on future refresh height If the refresh height is in the future, the current code will loop till the actual height reaches this. Fix it by bailing out if we receive only three hashes, which is what we set in the call parameters. --- src/wallet/wallet2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3cbe4cfe..d357815b 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1601,7 +1601,7 @@ void wallet2::fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, while(m_run.load(std::memory_order_relaxed) && current_index < stop_height) { pull_hashes(0, blocks_start_height, short_chain_history, hashes); - if (hashes.size() < 3) + if (hashes.size() <= 3) return; if (hashes.size() + current_index < stop_height) { std::list::iterator right;