LCOV - code coverage report
Current view: top level - src/node - interface_ui.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 8 8
Test Date: 2026-06-19 07:49:37 Functions: 100.0 % 3 3
Branches: 53.3 % 30 16

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2010-present The Bitcoin Core developers
       2                 :             : // Distributed under the MIT software license, see the accompanying
       3                 :             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4                 :             : 
       5                 :             : #include <node/interface_ui.h>
       6                 :             : 
       7                 :             : #include <util/btcsignals.h>
       8                 :             : #include <util/string.h>
       9                 :             : #include <util/translation.h>
      10                 :             : 
      11                 :             : using util::MakeUnorderedList;
      12                 :             : 
      13                 :             : CClientUIInterface uiInterface;
      14                 :             : 
      15                 :         173 : bool InitError(const bilingual_str& str)
      16                 :             : {
      17                 :         173 :     uiInterface.ThreadSafeMessageBox(str, CClientUIInterface::MSG_ERROR);
      18                 :         173 :     return false;
      19                 :             : }
      20                 :             : 
      21                 :          27 : bool InitError(const bilingual_str& str, const std::vector<std::string>& details)
      22                 :             : {
      23                 :             :     // For now just flatten the list of error details into a string to pass to
      24                 :             :     // the base InitError overload. In the future, if more init code provides
      25                 :             :     // error details, the details could be passed separately from the main
      26                 :             :     // message for rich display in the GUI. But currently the only init
      27                 :             :     // functions which provide error details are ones that run during early init
      28                 :             :     // before the GUI uiInterface is registered, so there's no point passing
      29                 :             :     // main messages and details separately to uiInterface yet.
      30   [ +  +  +  -  :          69 :     return InitError(details.empty() ? str : str + Untranslated(strprintf(":\n%s", MakeUnorderedList(details))));
          +  -  +  -  +  
          -  +  -  +  -  
          +  +  +  +  +  
          +  +  +  -  -  
          -  -  -  -  -  
                      - ]
      31                 :             : }
      32                 :             : 
      33                 :           8 : void InitWarning(const bilingual_str& str)
      34                 :             : {
      35                 :           8 :     uiInterface.ThreadSafeMessageBox(str, CClientUIInterface::MSG_WARNING);
      36                 :           8 : }
        

Generated by: LCOV version 2.0-1