diff --git a/src/main.cpp b/src/main.cpp index 801442e..c134e07 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ static void usage() { - printf( + printf("P2Pool %s\n" "\nUsage:\n\n" \ "--wallet Wallet address to mine to. Subaddresses and integrated addresses are not supported!\n" "--host IP address of your Monero node, default is 127.0.0.1\n" @@ -39,6 +39,7 @@ static void usage() "--help Show this help message\n\n" "Example command line:\n\n" "%s --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:%d --p2p 0.0.0.0:%d\n\n", + p2pool::VERSION, #ifdef _WIN32 "p2pool.exe" #else diff --git a/src/p2pool.cpp b/src/p2pool.cpp index b1b0246..513dff2 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -50,6 +50,8 @@ p2pool::p2pool(int argc, char* argv[]) , m_updateSeed(true) , m_submitBlockData{} { + LOGINFO(1, log::LightCyan() << VERSION); + if (!m_params->m_wallet.valid()) { LOGERR(1, "Invalid wallet address. Try \"p2pool --help\"."); panic(); diff --git a/src/util.cpp b/src/util.cpp index 3fd7ac4..1ad0cf6 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -29,6 +29,22 @@ static constexpr char log_category_prefix[] = "Util "; namespace p2pool { +#define STR2(X) STR(X) +#define STR(X) #X + +const char* VERSION = "v1.1 (built" +#if defined(__clang__) + " with clang/" __clang_version__ +#elif defined(__GNUC__) + " with GCC/" STR2(__GNUC__) "." STR2(__GNUC_MINOR__) "." STR2(__GNUC_PATCHLEVEL__) +#elif defined(_MSC_VER) + " with MSVC/" STR2(_MSC_VER) +#endif +" on " __DATE__ ")"; + +#undef STR2 +#undef STR + MinerCallbackHandler::~MinerCallbackHandler() {} void panic() diff --git a/src/util.h b/src/util.h index ae436b9..c859ad5 100644 --- a/src/util.h +++ b/src/util.h @@ -19,6 +19,8 @@ namespace p2pool { +extern const char* VERSION; + template struct not_implemented { enum { value = 0 }; }; struct nocopy_nomove