Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

clientversion.cpp File Reference
#include <clientversion.h>
#include <tinyformat.h>
+ Include dependency graph for clientversion.cpp:

Go to the source code of this file.

Macros

#define CLIENT_VERSION_SUFFIX   ""
 Client version number. More...
 
#define BUILD_DESC_WITH_SUFFIX(maj, min, rev, build, suffix)   "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix)
 The following part of the code determines the CLIENT_BUILD variable. More...
 
#define BUILD_DESC_FROM_COMMIT(maj, min, rev, build, commit)   "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit
 
#define BUILD_DESC_FROM_UNKNOWN(maj, min, rev, build)   "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
 
#define BUILD_DESC   BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)
 

Functions

const std::string CLIENT_NAME ("Dash Core")
 Name of client reported in the 'version' message. More...
 
const std::string CLIENT_BUILD (BUILD_DESC CLIENT_VERSION_SUFFIX)
 
std::string FormatVersion (int nVersion)
 
std::string FormatFullVersion ()
 
std::string FormatSubVersion (const std::string &name, int nClientVersion, const std::vector< std::string > &comments)
 Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) More...
 

Macro Definition Documentation

◆ BUILD_DESC

#define BUILD_DESC   BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)

Definition at line 65 of file clientversion.cpp.

◆ BUILD_DESC_FROM_COMMIT

#define BUILD_DESC_FROM_COMMIT (   maj,
  min,
  rev,
  build,
  commit 
)    "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit

Definition at line 53 of file clientversion.cpp.

◆ BUILD_DESC_FROM_UNKNOWN

#define BUILD_DESC_FROM_UNKNOWN (   maj,
  min,
  rev,
  build 
)    "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"

Definition at line 56 of file clientversion.cpp.

◆ BUILD_DESC_WITH_SUFFIX

#define BUILD_DESC_WITH_SUFFIX (   maj,
  min,
  rev,
  build,
  suffix 
)    "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix)

The following part of the code determines the CLIENT_BUILD variable.

Several mechanisms are used for this:

  • first, if HAVE_BUILD_INFO is defined, include build.h, a file that is generated by the build environment, possibly containing the output of git-describe in a macro called BUILD_DESC
  • secondly, if this is an exported version of the code, GIT_ARCHIVE will be defined (automatically using the export-subst git attribute), and GIT_COMMIT will contain the commit id.
  • then, three options exist for determining CLIENT_BUILD:
    • if BUILD_DESC is defined, use that literally (output of git-describe)
    • if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
    • otherwise, use v[maj].[min].[rev].[build]-unk finally CLIENT_VERSION_SUFFIX is addedFirst, include build.h if requested git will put "#define GIT_ARCHIVE 1" on the next line inside archives.
      Format
      n::define GIT_ARCHIVE 1

Definition at line 50 of file clientversion.cpp.

◆ CLIENT_VERSION_SUFFIX

#define CLIENT_VERSION_SUFFIX   ""

Client version number.

Definition at line 20 of file clientversion.cpp.

Function Documentation

◆ CLIENT_BUILD()

const std::string CLIENT_BUILD ( BUILD_DESC  CLIENT_VERSION_SUFFIX)

Referenced by FormatFullVersion().

◆ CLIENT_NAME()

const std::string CLIENT_NAME ( "Dash Core"  )

Name of client reported in the 'version' message.

Report the same name for both dashd and dash-qt, to make it harder for attackers to target servers or GUI users specifically.

◆ FormatFullVersion()

◆ FormatSubVersion()

std::string FormatSubVersion ( const std::string &  name,
int  nClientVersion,
const std::vector< std::string > &  comments 
)

Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)

Definition at line 87 of file clientversion.cpp.

References FormatVersion(), and name.

Referenced by AppInitMain().

◆ FormatVersion()

std::string FormatVersion ( int  nVersion)

Definition at line 71 of file clientversion.cpp.

References strprintf.

Referenced by FormatSubVersion().

Released under the MIT license