|
6 | 6 | #include <warnings.h>
|
7 | 7 |
|
8 | 8 | #include <sync.h>
|
| 9 | +#include <util/string.h> |
9 | 10 | #include <util/system.h>
|
10 | 11 | #include <util/translation.h>
|
11 | 12 |
|
| 13 | +#include <vector> |
| 14 | + |
12 | 15 | static Mutex g_warnings_mutex;
|
13 | 16 | static std::string strMiscWarning GUARDED_BY(g_warnings_mutex);
|
14 | 17 | static bool fLargeWorkForkFound GUARDED_BY(g_warnings_mutex) = false;
|
@@ -40,32 +43,34 @@ void SetfLargeWorkInvalidChainFound(bool flag)
|
40 | 43 |
|
41 | 44 | std::string GetWarnings(bool verbose)
|
42 | 45 | {
|
43 |
| - std::string warnings_concise; |
44 |
| - std::string warnings_verbose; |
45 |
| - const std::string warning_separator = "<hr />"; |
| 46 | + bilingual_str warnings_concise; |
| 47 | + std::vector<bilingual_str> warnings_verbose; |
46 | 48 |
|
47 | 49 | LOCK(g_warnings_mutex);
|
48 | 50 |
|
49 | 51 | // Pre-release build warning
|
50 | 52 | if (!CLIENT_VERSION_IS_RELEASE) {
|
51 |
| - warnings_concise = "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"; |
52 |
| - warnings_verbose = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications").translated; |
| 53 | + warnings_concise = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"); |
| 54 | + warnings_verbose.emplace_back(warnings_concise); |
53 | 55 | }
|
54 | 56 |
|
55 | 57 | // Misc warnings like out of disk space and clock is wrong
|
56 |
| - if (strMiscWarning != "") { |
57 |
| - warnings_concise = strMiscWarning; |
58 |
| - warnings_verbose += (warnings_verbose.empty() ? "" : warning_separator) + strMiscWarning; |
| 58 | + if (!strMiscWarning.empty()) { |
| 59 | + warnings_concise = Untranslated(strMiscWarning); |
| 60 | + warnings_verbose.emplace_back(warnings_concise); |
59 | 61 | }
|
60 | 62 |
|
61 | 63 | if (fLargeWorkForkFound) {
|
62 |
| - warnings_concise = "Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues."; |
63 |
| - warnings_verbose += (warnings_verbose.empty() ? "" : warning_separator) + _("Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.").translated; |
| 64 | + warnings_concise = _("Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues."); |
| 65 | + warnings_verbose.emplace_back(warnings_concise); |
64 | 66 | } else if (fLargeWorkInvalidChainFound) {
|
65 |
| - warnings_concise = "Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade."; |
66 |
| - warnings_verbose += (warnings_verbose.empty() ? "" : warning_separator) + _("Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.").translated; |
| 67 | + warnings_concise = _("Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade."); |
| 68 | + warnings_verbose.emplace_back(warnings_concise); |
| 69 | + } |
| 70 | + |
| 71 | + if (verbose) { |
| 72 | + return Join(warnings_verbose, Untranslated("<hr />")).translated; |
67 | 73 | }
|
68 | 74 |
|
69 |
| - if (verbose) return warnings_verbose; |
70 |
| - else return warnings_concise; |
| 75 | + return warnings_concise.original; |
71 | 76 | }
|
0 commit comments