Skip to content

Commit

Permalink
qt, pos: Display a warning on GUI if unable to stake
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Sep 20, 2023
1 parent c25fa7b commit ec638b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/node/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@ void PoSMiner(std::shared_ptr<CWallet> pwallet, NodeContext& m_node)
LogPrintf("Set proof-of-stake timeout: %ums for %u UTXOs\n", pos_timio, vCoins.size());
}

std::string strMintMessage = _("Info: Staking suspended due to locked wallet.").translated;
std::string strMintSyncMessage = _("Info: Staking suspended while synchronizing wallet.").translated;
std::string strMintDisabledMessage = _("Info: Staking disabled by 'nominting' option.").translated;
std::string strMintBlockMessage = _("Info: Staking suspended due to block creation failure.").translated;
std::string strMintMessage = _("Info: Staking suspended due to locked wallet").translated;
std::string strMintSyncMessage = _("Info: Staking suspended while synchronizing wallet").translated;
std::string strMintDisabledMessage = _("Info: Staking disabled by 'nostaking' option").translated;
std::string strMintBlockMessage = _("Info: Staking suspended due to block creation failure").translated;
std::string strMintEmpty = "";
if (!gArgs.GetBoolArg("-staking", DEFAULT_STAKE))
{
Expand Down
7 changes: 7 additions & 0 deletions src/warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ bilingual_str GetWarnings(bool verbose)
warnings_verbose.emplace_back(warnings_concise);
}

// Wallet warnings for staking
if (strMintWarning != "")
{
warnings_concise = Untranslated(strMintWarning);
warnings_verbose.emplace_back(warnings_concise);
}

// Misc warnings like out of disk space and clock is wrong
if (!g_misc_warnings.empty()) {
warnings_concise = g_misc_warnings;
Expand Down

0 comments on commit ec638b1

Please sign in to comment.