LCOV - code coverage report
Current view: top level - src/common - license_info.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 95.2 % 21 20
Test Date: 2026-04-07 04:59:12 Functions: 100.0 % 2 2
Branches: 43.3 % 30 13

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) The Bitcoin Core developers
       2                 :             : // Distributed under the MIT software license, see the accompanying
       3                 :             : // file COPYING or https://opensource.org/license/mit/.
       4                 :             : 
       5                 :             : #include <bitcoin-build-config.h> // IWYU pragma: keep
       6                 :             : 
       7                 :             : #include <common/license_info.h>
       8                 :             : 
       9                 :             : #include <tinyformat.h>
      10                 :             : #include <util/translation.h>
      11                 :             : 
      12                 :             : #include <string>
      13                 :             : 
      14                 :           8 : std::string CopyrightHolders(const std::string& strPrefix)
      15                 :             : {
      16                 :           8 :     const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS), COPYRIGHT_HOLDERS_SUBSTITUTION).translated;
      17         [ +  - ]:           8 :     std::string strCopyrightHolders = strPrefix + copyright_devs;
      18                 :             : 
      19                 :             :     // Make sure Bitcoin Core copyright is not removed by accident
      20         [ -  + ]:           8 :     if (copyright_devs.find("Bitcoin Core") == std::string::npos) {
      21   [ #  #  #  # ]:           0 :         strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
      22                 :             :     }
      23                 :           8 :     return strCopyrightHolders;
      24                 :           8 : }
      25                 :             : 
      26                 :           8 : std::string LicenseInfo()
      27                 :             : {
      28                 :           8 :     const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>";
      29                 :             : 
      30   [ +  -  +  -  :          40 :     return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR).translated + " ") + "\n" +
                   +  - ]
      31                 :           8 :            "\n" +
      32         [ +  - ]:          16 :            strprintf(_("Please contribute if you find %s useful. "
      33                 :             :                        "Visit %s for further information about the software."),
      34                 :             :                      CLIENT_NAME, "<" CLIENT_URL ">")
      35         [ +  - ]:          16 :                .translated +
      36                 :           8 :            "\n" +
      37         [ +  - ]:          24 :            strprintf(_("The source code is available from %s."), URL_SOURCE_CODE).translated +
      38         [ +  - ]:          16 :            "\n" +
      39                 :           8 :            "\n" +
      40   [ +  -  +  - ]:          24 :            _("This is experimental software.") + "\n" +
      41   [ +  -  +  - ]:          24 :            strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s"), "COPYING", "<https://opensource.org/license/MIT>").translated +
      42                 :           8 :            "\n";
      43                 :           8 : }
        

Generated by: LCOV version 2.0-1