Skip to content

Commit

Permalink
Merge pull request #229 from zathras-crypto/0.0.9-Z-Alerts
Browse files Browse the repository at this point in the history
Add commit info to getinfo_MP
  • Loading branch information
m21 committed Dec 8, 2014
2 parents a4be1a2 + df73ece commit 2ccd8e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mastercore_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "util.h"
#include "init.h"
#include "wallet.h"
#include "clientversion.h"

#include <stdint.h>
#include <string.h>
Expand Down Expand Up @@ -1883,9 +1884,10 @@ Value getinfo_MP(const Array& params, bool fHelp)
Object infoResponse;
// other bits of info we want to report should be included here

// provide the mastercore and bitcoin version
// provide the mastercore and bitcoin version and if available commit id
infoResponse.push_back(Pair("mastercoreversion", "0.0." + boost::lexical_cast<string>((double)OMNICORE_VERSION_BASE/10) + OMNICORE_VERSION_TYPE ));
infoResponse.push_back(Pair("bitcoincoreversion", "0." + boost::lexical_cast<string>((int)CLIENT_VERSION/100)));
infoResponse.push_back(Pair("commitinfo", COMMIT_INFO));

// provide the current block details
uint64_t block = chainActive.Height();
Expand Down
10 changes: 10 additions & 0 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const std::string CLIENT_NAME("Satoshi");
#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_SUFFIX_ONLY(suffix) \
DO_STRINGIZE(suffix)

#ifndef BUILD_DESC
# ifdef BUILD_SUFFIX
# define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX)
Expand All @@ -67,5 +70,12 @@ const std::string CLIENT_NAME("Satoshi");
# endif
#endif

#ifdef BUILD_SUFFIX
# define COMMIT_DEF BUILD_SUFFIX_ONLY(BUILD_SUFFIX)
#else
# define COMMIT_DEF ""
#endif

const std::string COMMIT_INFO(COMMIT_DEF);
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
const std::string CLIENT_DATE(BUILD_DATE);
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static const int CLIENT_VERSION =
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;

extern const std::string COMMIT_INFO;
//
// network protocol versioning
//
Expand Down

0 comments on commit 2ccd8e2

Please sign in to comment.