1
0
Fork 0
forked from lthn/blockchain

simplewallet: bring pulling error up to the user on refresh

This commit is contained in:
sowle 2020-07-22 14:09:55 +03:00
parent 28f8f86860
commit 399c09871f
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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;
}
}