refactor: Use AbortError in FatalError #19295

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2006-refactorAbortError changing 3 files +3 −6
  1. MarcoFalke commented at 2:53 pm on June 16, 2020: member

    FatalError has been copied from AbortNode, so the two should use the same style to avoid confusion.

    Follow-up to #18927

  2. refactor: Use AbortError in FatalError
    This is needed for consistency with AbortNode
    fa02b47313
  3. MarcoFalke added the label Refactoring on Jun 16, 2020
  4. hebasto commented at 6:58 pm on June 16, 2020: member
    Concept ACK.
  5. in src/ui_interface.h:125 in fa02b47313
    121@@ -122,6 +122,7 @@ void InitWarning(const bilingual_str& str);
    122 
    123 /** Show error message **/
    124 bool InitError(const bilingual_str& str);
    125+constexpr auto AbortError = InitError;
    


    hebasto commented at 6:38 am on June 17, 2020:
    Why is this header selected to host this expression?

    MarcoFalke commented at 10:22 am on June 17, 2020:
    It should be in a header because it is used in two places. Any suggestions where to put it?

    hebasto commented at 10:29 am on June 17, 2020:
    I meant “why in this header” rather “why in header” :) This header looks good to me. Another possible one is validation.h.

    hebasto commented at 10:30 am on June 17, 2020:
    But your variant is better for a code reader, I think.
  6. hebasto approved
  7. hebasto commented at 6:38 am on June 17, 2020: member

    ACK fa02b473132932c200be1750d1a5b1de14ea2383, I have reviewed the code and it looks OK, I agree it can be merged.

    Suggestions for followups:

    • remove “debug.log” from the translated string
    • replace “debug.log” with the actual log file name (-debuglogfile option)
  8. MarcoFalke merged this on Jun 17, 2020
  9. MarcoFalke closed this on Jun 17, 2020

  10. MarcoFalke deleted the branch on Jun 17, 2020
  11. Sjors commented at 4:14 pm on June 17, 2020: member

    As @achow101 noticed on IRC, this PR appears to cause the following error on Ubuntu 20.04, but not on macOS. Apparently only with --enable-debug.

    0./configure --enable-debug --with-incompatible-bdb --enable-werror
    1make
    
    0/usr/bin/ld: bitcoin_wallet-bitcoin-wallet.o:(.data.rel.ro+0x8): undefined reference to `InitError(bilingual_str const&)'
    1/usr/bin/ld: libbitcoin_wallet_tool.a(libbitcoin_wallet_tool_a-wallettool.o):(.data.rel.ro+0x8): undefined reference to `InitError(bilingual_str const&)'
    2/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-salvage.o):(.data.rel.ro+0x8): undefined reference to `InitError(bilingual_str const&)'
    3/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o):(.data.rel.ro+0x8): undefined reference to `InitError(bilingual_str const&)'
    4/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-walletdb.o):(.data.rel.ro+0x8): undefined reference to `InitError(bilingual_str const&)'
    5/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o):(.data.rel.ro+0x8): more undefined references to `InitError(bilingual_str const&)' follow
    6collect2: error: ld returned 1 exit status
    
  12. jonatack commented at 4:42 pm on June 17, 2020: member

    I’m seeing the issue on Debian as well.

    0$ uname -a
    1Linux 4.19.0-9-amd64 [#1](/bitcoin-bitcoin/1/) SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux
    
  13. hebasto commented at 4:49 pm on June 17, 2020: member
  14. MarcoFalke referenced this in commit f3d776b593 on Jun 19, 2020
  15. Fabcien referenced this in commit 978bd5b488 on Dec 11, 2020
  16. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

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: 2024-11-23 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me