forked from lthn/blockchain
simplewallet: bring pulling error up to the user on refresh
This commit is contained in:
parent
28f8f86860
commit
399c09871f
1 changed files with 4 additions and 0 deletions
|
|
@ -1877,12 +1877,16 @@ void wallet2::refresh(size_t & blocks_fetched, bool& received_money, std::atomic
|
|||
if (++try_count > 3)
|
||||
return;
|
||||
WLT_LOG_L2("no connection to the daemon, wait and try pull_blocks again (try_count: " << try_count << ", blocks_fetched: " << blocks_fetched << ")");
|
||||
if (m_wcallback)
|
||||
m_wcallback->on_message(tools::i_wallet2_callback::ms_red, "no connection to daemon");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
blocks_fetched += added_blocks;
|
||||
WLT_LOG_ERROR("refresh->pull_blocks failed, try_count: " << try_count << ", blocks_fetched: " << blocks_fetched << ", exception: " << e.what());
|
||||
if (m_wcallback)
|
||||
m_wcallback->on_message(tools::i_wallet2_callback::ms_red, std::string("error on pulling blocks: ") + e.what());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue