diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-01-16 19:07:13 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-01-16 19:07:13 +0200 |
commit | 538043bdcd29f4929cb1de62e914177a339df514 (patch) | |
tree | 31126afe56123e287c180213754b4e13cd20de36 /src/wallet | |
parent | Merge pull request #4986 (diff) | |
parent | wallet2: fix accessing unwound stack on exception (diff) | |
download | monero-538043bdcd29f4929cb1de62e914177a339df514.tar.xz |
Merge pull request #4987
841a6acd wallet2: fix accessing unwound stack on exception (moneromooo-monero)
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet2.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3b6f9daf6..427917634 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2800,13 +2800,16 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo bool first = true; while(m_run.load(std::memory_order_relaxed)) { + uint64_t next_blocks_start_height; + std::vector<cryptonote::block_complete_entry> next_blocks; + std::vector<parsed_block> next_parsed_blocks; + bool error; try { // pull the next set of blocks while we're processing the current one - uint64_t next_blocks_start_height; - std::vector<cryptonote::block_complete_entry> next_blocks; - std::vector<parsed_block> next_parsed_blocks; - bool error = false; + error = false; + next_blocks.clear(); + next_parsed_blocks.clear(); added_blocks = 0; if (!first && blocks.empty()) { @@ -2844,6 +2847,11 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo start_height = stop_height; throw std::runtime_error(""); // loop again } + catch (const std::exception &e) + { + MERROR("Error parsing blocks: " << e.what()); + error = true; + } blocks_fetched += added_blocks; } waiter.wait(&tpool); |