Pass bilingual_str argument to AbortNode()#18927
Conversation
|
This PR could be tested with a patch similar to the following: diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts
index 73c18cd4d..13bda2db2 100644
--- a/src/qt/locale/bitcoin_nl.ts
+++ b/src/qt/locale/bitcoin_nl.ts
@@ -3524,8 +3524,8 @@ Notitie: Omdat de vergoeding per byte wordt gerekend, zal een vergoeding van "10
<translation>P2P-adressen aan het laden...</translation>
</message>
<message>
- <source>Error: Disk space is too low!</source>
- <translation>Error: Opslagruimte te weinig!</translation>
+ <source>Disk space is too low!</source>
+ <translation>Opslagruimte te weinig!</translation>
</message>
<message>
<source>Loading banlist...</source>
diff --git a/src/validation.cpp b/src/validation.cpp
index 9034f66e9..c9539c325 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2317,7 +2317,7 @@ bool CChainState::FlushStateToDisk(
// Write blocks and block index to disk.
if (fDoFullFlush || fPeriodicWrite) {
// Depend on nMinDiskSpace to ensure we can write block index
- if (!CheckDiskSpace(GetBlocksDir())) {
+ if (CheckDiskSpace(GetBlocksDir())) {
return AbortNode(state, "Disk space is too low!", _("Disk space is too low!"));
}
{ |
|
Updated 1511dd0 -> 6fad0cf (pr18927.02 -> pr18927.03, diff):
|
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
|
Updated 6fad0cf -> 4067da9 (pr18927.03 -> pr18927.04, diff):
|
|
Rebased 4067da9 -> c5e34e5 (pr18927.04 -> pr18927.05) due to the conflict with #18922. |
|
Needs rebase |
Since bilingual_str type is fully supported, the MSG_NOPREFIX flag is no longer needed.
Rebased c5e34e5 -> d924f2a (pr18927.05 -> pr18927.07). |
src/validation.cpp
Outdated
| uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR); | ||
| } else { | ||
| uiInterface.ThreadSafeMessageBox(_("Error: A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX); | ||
| uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR); |
There was a problem hiding this comment.
Now that the signature is identical to InitError, the call could be simplified to just a call to AbortError, which would be a new alias for InitError?
constexpr auto AbortError = InitError;There was a problem hiding this comment.
Now that the signature is identical to InitError...
Which function signature do you mean?
src/validation.cpp
Outdated
| uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR); | ||
| } else { | ||
| uiInterface.ThreadSafeMessageBox(_("Error: A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX); | ||
| uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR); |
There was a problem hiding this comment.
All that InitError does is pass a translated string into ThreadSafeMessageBox, so this line could be replaced by a simple call to InitError, no?
| uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR); | |
| AbortError(_("A fatal internal error occurred, see debug.log for details")); |
|
Updated d924f2a -> 5527be0 (pr18927.07 -> pr18927.08, diff): |
|
ACK 5527be0 👟 Show signature and timestampSignature: Timestamp of file with hash |
fa02b47 refactor: Use AbortError in FatalError (MarcoFalke) Pull request description: `FatalError` has been copied from `AbortNode`, so the two should use the same style to avoid confusion. Follow-up to #18927 ACKs for top commit: hebasto: ACK fa02b47, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 2cf6d18a6ffb5c2e5cf54f0a072a7cef6dc7e924152b2fee44e6ff2c6c53bad962afd364eda30d8a73883d656429ea68391090e6a27057e69eaefd7c4dad0a33
5527be0 refactor: Add AbortError alias (Hennadii Stepanov) d924f2a Drop MSG_NOPREFIX flag (Hennadii Stepanov) 083daf7 Pass bilingual_str argument to AbortNode() (Hennadii Stepanov) d1cca12 refactor: Use bilingual_str::empty() (Hennadii Stepanov) Pull request description: This PR is a [followup](bitcoin#16218 (comment)) of bitcoin#16224, and it adds `bilingual_str` type argument support to the `AbortNode()` functions. ACKs for top commit: MarcoFalke: ACK 5527be0 👟 Tree-SHA512: bf8b15b14912b1f672e6e588fffa1e6eb6f00b4b23d15d0ced7f18fbdf76919244427feb7217007fe29617049308e13def893a03a87358db819cca9692f59905
Summary: ``` This PR is a followup of #16224, and it adds bilingual_str type argument support to the AbortNode() functions. ``` Backport of core [[bitcoin/bitcoin#18927 | PR18927]]. Depends on D8648. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D8649

This PR is a followup of #16224, and it adds
bilingual_strtype argument support to theAbortNode()functions.