diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-06-26 06:56:44 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-06-26 06:58:37 +0100 |
commit | d3bb72fff16cd12a41720887dbf576e11ee47f4a (patch) | |
tree | f3ed3585343ac756c27ede11ad2de25f510966c8 | |
parent | wallet: fix refresh_from_height setting on new wallet (diff) | |
download | monero-d3bb72fff16cd12a41720887dbf576e11ee47f4a.tar.xz |
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.
-rw-r--r-- | src/wallet/wallet2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3cbe4cfe7..d357815b7 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<crypto::hash>::iterator right; |