diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-08-04 12:41:15 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-08-22 09:57:46 +0000 |
commit | 62511df622262ed1fcb73c3092f0c072ed93cc00 (patch) | |
tree | 45d281ea906bc6d9249ad719730768921c13fa90 | |
parent | wallet2: trim hash chain after fast refresh of hashes (diff) | |
download | monero-62511df622262ed1fcb73c3092f0c072ed93cc00.tar.xz |
wallet2: fix refresh retry when a block/tx fails to parse
It would switch to a new set of blocks and fail, getting out of sync
with the hash chain in the process
-rw-r--r-- | src/wallet/wallet2.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 8da62c76d..f4b6708fc 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2498,10 +2498,6 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo break; } - // switch to the new blocks from the daemon - blocks_start_height = next_blocks_start_height; - blocks = std::move(next_blocks); - parsed_blocks = std::move(next_parsed_blocks); first = false; // handle error from async fetching thread @@ -2509,6 +2505,11 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo { throw std::runtime_error("proxy exception in refresh thread"); } + + // switch to the new blocks from the daemon + blocks_start_height = next_blocks_start_height; + blocks = std::move(next_blocks); + parsed_blocks = std::move(next_parsed_blocks); } catch (const std::exception&) { |