This PR is a followup of #16224, and it adds bilingual_str type argument support to the AbortNode() functions.
Pass bilingual_str argument to AbortNode() #18927
pull hebasto wants to merge 4 commits into bitcoin:master from hebasto:200510-abort changing 5 files +28 −38-
hebasto commented at 10:12 AM on May 10, 2020: member
-
hebasto commented at 10:15 AM on May 10, 2020: member
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!")); } {$ ./src/qt/bitcoin-qt -testnet -lang=nl Error: Disk space is too low! Error: Disk space is too low! Error: Disk space is too low!
$ tail -4 ~/.bitcoin/testnet3/debug.log 2020-05-10T09:55:41Z [shutoff] *** Disk space is too low! 2020-05-10T09:55:41Z [shutoff] Error: Disk space is too low! 2020-05-10T09:55:41Z [shutoff] ForceFlushStateToDisk: failed to flush state (Disk space is too low!) 2020-05-10T09:55:41Z [shutoff] Shutdown: done - hebasto force-pushed on May 10, 2020
- DrahtBot added the label GUI on May 10, 2020
- DrahtBot added the label Utils/log/libs on May 10, 2020
- DrahtBot added the label Validation on May 10, 2020
-
in src/util/translation.h:22 in 1511dd0b1a outdated
15 | @@ -16,6 +16,11 @@ 16 | struct bilingual_str { 17 | std::string original; 18 | std::string translated; 19 | + 20 | + bool empty() const 21 | + { 22 | + return original.empty() && translated.empty();
MarcoFalke commented at 12:23 PM on May 10, 2020:return original.empty();I think translators should not be able to influence executions paths by blanking messages
hebasto commented at 12:26 PM on May 10, 2020:I think translators should not be able to influence executions paths by blanking messages
Sure!
hebasto force-pushed on May 10, 2020hebasto commented at 12:32 PM on May 10, 2020: memberUpdated 1511dd0b1a44727be652b61256899b0ce8024178 -> 6fad0cf7a9b9492e92f6331db4cd6fcd14977d5e (pr18927.02 -> pr18927.03, diff):
- addressed @MarcoFalke's comment:
I think translators should not be able to influence executions paths by blanking messages
DrahtBot commented at 1:37 PM on May 10, 2020: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
No conflicts as of last run.
hebasto force-pushed on May 10, 2020hebasto commented at 2:08 PM on May 10, 2020: memberUpdated 6fad0cf7a9b9492e92f6331db4cd6fcd14977d5e -> 4067da94bbf24c6b2b9d45808ae33dc9e7b9d6d4 (pr18927.03 -> pr18927.04, diff):
- more uses of
bilingual_str::empty()
DrahtBot added the label Needs rebase on May 13, 2020hebasto force-pushed on May 14, 2020hebasto commented at 4:53 AM on May 14, 2020: memberRebased 4067da94bbf24c6b2b9d45808ae33dc9e7b9d6d4 -> c5e34e58801654028e3039188e2882e25df594a4 (pr18927.04 -> pr18927.05) due to the conflict with #18922.
DrahtBot removed the label Needs rebase on May 14, 2020MarcoFalke commented at 3:26 PM on June 4, 2020: memberNeeds rebase
hebasto force-pushed on Jun 4, 2020refactor: Use bilingual_str::empty() d1cca129b4Pass bilingual_str argument to AbortNode() 083daf7fbad924f2a596Drop MSG_NOPREFIX flag
Since bilingual_str type is fully supported, the MSG_NOPREFIX flag is no longer needed.
hebasto force-pushed on Jun 4, 2020hebasto commented at 3:34 PM on June 4, 2020: memberNeeds rebase
Rebased c5e34e58801654028e3039188e2882e25df594a4 -> d924f2a596c8f37deb2dd94069c578244823c31f (pr18927.05 -> pr18927.07).
hebasto closed this on Jun 6, 2020hebasto reopened this on Jun 6, 2020hebasto closed this on Jun 6, 2020hebasto reopened this on Jun 6, 2020in src/validation.cpp:1665 in d924f2a596 outdated
1664 | if (!userMessage.empty()) { 1665 | - uiInterface.ThreadSafeMessageBox(Untranslated(userMessage), "", CClientUIInterface::MSG_ERROR | prefix); 1666 | + uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR); 1667 | } else { 1668 | - uiInterface.ThreadSafeMessageBox(_("Error: A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX); 1669 | + uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR);
MarcoFalke commented at 12:24 PM on June 7, 2020: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;
hebasto commented at 6:32 AM on June 8, 2020:Now that the signature is identical to InitError...
Which function signature do you mean?
MarcoFalke commented at 10:46 AM on June 8, 2020:All that InitError does is pass a translated string into
ThreadSafeMessageBox, so this line could be replaced by a simple call to InitError, no?AbortError(_("A fatal internal error occurred, see debug.log for details"));
refactor: Add AbortError alias 5527be0627hebasto commented at 3:40 PM on June 8, 2020: memberUpdated d924f2a596c8f37deb2dd94069c578244823c31f -> 5527be06277647dffe7cda587c4bbfbec2a5c8ca (pr18927.07 -> pr18927.08, diff):
- implemented @MarcoFalke's suggestion (https://github.com/bitcoin/bitcoin/pull/18927#discussion_r436357871, #18927 (review))
hebasto closed this on Jun 9, 2020hebasto reopened this on Jun 9, 2020hebasto closed this on Jun 9, 2020hebasto reopened this on Jun 9, 2020MarcoFalke commented at 9:51 PM on June 9, 2020: memberACK 5527be06277647dffe7cda587c4bbfbec2a5c8ca 👟
<details><summary>Show signature and timestamp</summary>
Signature:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ACK 5527be06277647dffe7cda587c4bbfbec2a5c8ca 👟 -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p pUi2JQwAwwhgq56EfM6hpOzafEWzJZZinddkJuSLzeiDHy1b7SUgQVooQWpqBqiJ KaI87+DzkSGBOu0vqoy2DjuuFcyLpHSdOQ8fAJFOYbfxbx6M37bY7Hch+eeYivjt k5gPNiVBPzz6h68fxgPNshwHVR6qWzI5RgOe8/GsYrPbGjh42ueYgVZcHdxgqHEP vjHJzkU31LW3Ntqg1P6VuYt8uxGvXiejQOjACs9FxWgtemZMRnvHSrUIGfWNyRPt G9Y2ClnpZ5rhy6CW3FlyCPEtY6GofbQ9AUEUo/R6Dxv4xVk9xBw1wJ0vwV7q/clW OjTQgr8LK8puSiGHAhc3ee+3n+hsDmIuzfY4xLv3E4Bqe7/jbvlyNzQe/UfAiGSK 8PqZp0jk+ZG87qZuwNKYytvXDPNOAorN1SO8bIWUlt0cTlfKfQcdHnHAQYMdUxkl Xsu5LcmEgyuerJ7pPQCQ5gVYpCScCNjzwvOIKdkggY1zBJNB2YkdP3aKMYU+ezdL UbthjJ2Q =zsXO -----END PGP SIGNATURE-----Timestamp of file with hash
c4a6904cff17d24ba7d628d970246ed0ce8d86a0caa4d68859d702cd905c7c6a -</details>
MarcoFalke merged this on Jun 16, 2020MarcoFalke closed this on Jun 16, 2020hebasto deleted the branch on Jun 16, 2020MarcoFalke referenced this in commit 39bd9ddb87 on Jun 17, 2020sidhujag referenced this in commit f3dc64f18d on Jul 7, 2020Fabcien referenced this in commit 1ec7ba8346 on Dec 11, 2020DrahtBot locked this on Feb 15, 2022
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC
More mirrored repositories can be found on mirror.b10c.me