/ src / common / license_info.cpp
license_info.cpp
 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  std::string CopyrightHolders(const std::string& strPrefix)
15  {
16      const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS), COPYRIGHT_HOLDERS_SUBSTITUTION).translated;
17      std::string strCopyrightHolders = strPrefix + copyright_devs;
18  
19      // Make sure Bitcoin Core copyright is not removed by accident
20      if (copyright_devs.find("Bitcoin Core") == std::string::npos) {
21          strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
22      }
23      return strCopyrightHolders;
24  }
25  
26  std::string LicenseInfo()
27  {
28      const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>";
29  
30      return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR).translated + " ") + "\n" +
31             "\n" +
32             strprintf(_("Please contribute if you find %s useful. "
33                         "Visit %s for further information about the software."),
34                       CLIENT_NAME, "<" CLIENT_URL ">")
35                 .translated +
36             "\n" +
37             strprintf(_("The source code is available from %s."), URL_SOURCE_CODE).translated +
38             "\n" +
39             "\n" +
40             _("This is experimental software.") + "\n" +
41             strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s"), "COPYING", "<https://opensource.org/license/MIT>").translated +
42             "\n";
43  }