simplewallet: suggest hw_reconnect on refresh

This commit is contained in:
Samy
2026-08-22 18:58:19 +02:00
parent 0aa9c51bd8
commit fd86262a85
+6 -1
View File
@@ -5621,6 +5621,7 @@ bool simple_wallet::refresh_main(uint64_t start_height, enum ResetType reset, bo
uint64_t fetched_blocks = 0;
bool received_money = false;
bool ok = false;
bool suggest_hw_reconnect = false;
std::ostringstream ss;
try
{
@@ -5682,6 +5683,7 @@ bool simple_wallet::refresh_main(uint64_t start_height, enum ResetType reset, bo
{
LOG_ERROR("unexpected error: " << e.what());
ss << tr("unexpected error: ") << e.what();
suggest_hw_reconnect = true;
}
catch (...)
{
@@ -5691,7 +5693,10 @@ bool simple_wallet::refresh_main(uint64_t start_height, enum ResetType reset, bo
if (!ok)
{
fail_msg_writer() << tr("refresh failed: ") << ss.str() << ". " << tr("Blocks received: ") << fetched_blocks;
auto writer = fail_msg_writer();
writer << tr("refresh failed: ") << ss.str() << ". " << tr("Blocks received: ") << fetched_blocks;
if (suggest_hw_reconnect && m_wallet->key_on_device())
writer << "\n" << tr("Check that the HW wallet is connected and unlocked, then run 'hw_reconnect' before refreshing again.");
}
// prevent it from triggering the idle screen due to waiting for a foreground refresh