aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-10-30 17:18:17 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-10-30 17:24:36 +0100
commit8d2396c9c41cbd5b8746f48f41180697f58b0681 (patch)
treece5bb77b48ee354790eeae3f0ee3dd19d160b322 /src
parentc4761ffb70a9fc38b32f9febcac1434ffb4fee50 (diff)
parent71697f97d3f9512f0af934070690c14f1c0d95ea (diff)
Merge pull request #5164
71697f9 Separate protocol versioning from clientversion (Cory Fields)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/alert.cpp1
-rw-r--r--src/bitcoin-cli.cpp2
-rw-r--r--src/bitcoin-tx.cpp1
-rw-r--r--src/bitcoind.cpp1
-rw-r--r--src/clientversion.cpp (renamed from src/version.cpp)2
-rw-r--r--src/clientversion.h27
-rw-r--r--src/db.h1
-rw-r--r--src/leveldbwrapper.h1
-rw-r--r--src/net.cpp1
-rw-r--r--src/qt/clientmodel.cpp1
-rw-r--r--src/qt/recentrequeststablemodel.cpp1
-rw-r--r--src/qt/utilitydialog.cpp2
-rw-r--r--src/rpcmisc.cpp1
-rw-r--r--src/rpcnet.cpp1
-rw-r--r--src/rpcprotocol.cpp1
-rw-r--r--src/test/alert_tests.cpp2
-rw-r--r--src/test/bloom_tests.cpp1
-rw-r--r--src/test/checkblock_tests.cpp1
-rw-r--r--src/test/transaction_tests.cpp1
-rw-r--r--src/test/util_tests.cpp2
-rw-r--r--src/txmempool.cpp1
-rw-r--r--src/version.h22
23 files changed, 50 insertions, 30 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 91cc1b96e7..8253c4ab14 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -146,7 +146,7 @@ obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
$(abs_top_srcdir)
-libbitcoin_util_a-version.$(OBJEXT): obj/build.h
+libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
# server: shared between bitcoind and bitcoin-qt
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
@@ -241,6 +241,7 @@ libbitcoin_util_a_SOURCES = \
compat/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \
chainparamsbase.cpp \
+ clientversion.cpp \
random.cpp \
rpcprotocol.cpp \
sync.cpp \
@@ -249,7 +250,6 @@ libbitcoin_util_a_SOURCES = \
utilstrencodings.cpp \
utilmoneystr.cpp \
utiltime.cpp \
- version.cpp \
$(BITCOIN_CORE_H)
if GLIBC_BACK_COMPAT
@@ -354,7 +354,7 @@ clean-local:
.rc.o:
@test -f $(WINDRES)
- $(AM_V_GEN) $(WINDRES) -i $< -o $@
+ $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
.mm.o:
$(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
diff --git a/src/alert.cpp b/src/alert.cpp
index d495849206..f16898dc38 100644
--- a/src/alert.cpp
+++ b/src/alert.cpp
@@ -6,6 +6,7 @@
#include "alert.h"
#include "chainparams.h"
+#include "clientversion.h"
#include "key.h"
#include "net.h"
#include "timedata.h"
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index aa5e285b10..38fbc29faf 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -4,12 +4,12 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparamsbase.h"
+#include "clientversion.h"
#include "init.h"
#include "rpcclient.h"
#include "rpcprotocol.h"
#include "util.h"
#include "utilstrencodings.h"
-#include "version.h"
#include <boost/filesystem/operations.hpp>
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 6f3409edf3..c0d21ed36f 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
+#include "clientversion.h"
#include "core/transaction.h"
#include "core_io.h"
#include "keystore.h"
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index 0737b5a83d..a79e581a80 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -3,6 +3,7 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include "clientversion.h"
#include "rpcserver.h"
#include "init.h"
#include "main.h"
diff --git a/src/version.cpp b/src/clientversion.cpp
index d12b681e5c..4987c3ed38 100644
--- a/src/version.cpp
+++ b/src/clientversion.cpp
@@ -2,7 +2,7 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include "version.h"
+#include "clientversion.h"
#include "tinyformat.h"
diff --git a/src/clientversion.h b/src/clientversion.h
index cd7ceb78f0..acaf54c6af 100644
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -35,4 +35,31 @@
// Copyright string used in Windows .rc files
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers"
+/*
+ bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
+ WINDRES_PREPROC is defined to indicate that its pre-processor is running.
+ Anything other than a define should be guarded below.
+*/
+
+#if !defined(WINDRES_PREPROC)
+
+#include <string>
+#include <vector>
+
+static const int CLIENT_VERSION =
+ 1000000 * CLIENT_VERSION_MAJOR
+ + 10000 * CLIENT_VERSION_MINOR
+ + 100 * CLIENT_VERSION_REVISION
+ + 1 * CLIENT_VERSION_BUILD;
+
+extern const std::string CLIENT_NAME;
+extern const std::string CLIENT_BUILD;
+extern const std::string CLIENT_DATE;
+
+
+std::string FormatFullVersion();
+std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
+
+#endif // WINDRES_PREPROC
+
#endif // CLIENTVERSION_H
diff --git a/src/db.h b/src/db.h
index 0cbdd8b91b..85ffbae1cb 100644
--- a/src/db.h
+++ b/src/db.h
@@ -6,6 +6,7 @@
#ifndef BITCOIN_DB_H
#define BITCOIN_DB_H
+#include "clientversion.h"
#include "serialize.h"
#include "streams.h"
#include "sync.h"
diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h
index d997d56e00..10b7a2427c 100644
--- a/src/leveldbwrapper.h
+++ b/src/leveldbwrapper.h
@@ -5,6 +5,7 @@
#ifndef BITCOIN_LEVELDBWRAPPER_H
#define BITCOIN_LEVELDBWRAPPER_H
+#include "clientversion.h"
#include "serialize.h"
#include "streams.h"
#include "util.h"
diff --git a/src/net.cpp b/src/net.cpp
index 6cccdca952..5ceb82cf8b 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -11,6 +11,7 @@
#include "addrman.h"
#include "chainparams.h"
+#include "clientversion.h"
#include "core/transaction.h"
#include "ui_interface.h"
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 738fb48ef8..aedda49071 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -10,6 +10,7 @@
#include "alert.h"
#include "chainparams.h"
#include "checkpoints.h"
+#include "clientversion.h"
#include "main.h"
#include "net.h"
#include "ui_interface.h"
diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp
index 5deac8007c..5533adab8b 100644
--- a/src/qt/recentrequeststablemodel.cpp
+++ b/src/qt/recentrequeststablemodel.cpp
@@ -5,6 +5,7 @@
#include "recentrequeststablemodel.h"
#include "bitcoinunits.h"
+#include "clientversion.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "streams.h"
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
index 84f88dff5a..58bf040624 100644
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -10,8 +10,8 @@
#include "clientmodel.h"
#include "guiutil.h"
+#include "clientversion.h"
#include "init.h"
-#include "version.h"
#include <stdio.h>
diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp
index 92ed1c3e2b..08e956c961 100644
--- a/src/rpcmisc.cpp
+++ b/src/rpcmisc.cpp
@@ -4,6 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
+#include "clientversion.h"
#include "init.h"
#include "main.h"
#include "net.h"
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index 12dcd5b540..46b5f3d7ad 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -4,6 +4,7 @@
#include "rpcserver.h"
+#include "clientversion.h"
#include "main.h"
#include "net.h"
#include "netbase.h"
diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp
index c99d113bc3..c2ce73106f 100644
--- a/src/rpcprotocol.cpp
+++ b/src/rpcprotocol.cpp
@@ -5,6 +5,7 @@
#include "rpcprotocol.h"
+#include "clientversion.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp
index 28610f0d2e..9cf7a98f46 100644
--- a/src/test/alert_tests.cpp
+++ b/src/test/alert_tests.cpp
@@ -7,13 +7,13 @@
//
#include "alert.h"
+#include "clientversion.h"
#include "data/alertTests.raw.h"
#include "serialize.h"
#include "streams.h"
#include "util.h"
#include "utilstrencodings.h"
-#include "version.h"
#include <fstream>
diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp
index 99b21a23a0..783e284af5 100644
--- a/src/test/bloom_tests.cpp
+++ b/src/test/bloom_tests.cpp
@@ -5,6 +5,7 @@
#include "bloom.h"
#include "base58.h"
+#include "clientversion.h"
#include "key.h"
#include "main.h"
#include "serialize.h"
diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
index 9151fdc0c8..fc36b43e16 100644
--- a/src/test/checkblock_tests.cpp
+++ b/src/test/checkblock_tests.cpp
@@ -8,6 +8,7 @@
+#include "clientversion.h"
#include "main.h"
#include "utiltime.h"
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index c46c31e99f..d4c9b1a0ea 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -5,6 +5,7 @@
#include "data/tx_invalid.json.h"
#include "data/tx_valid.json.h"
+#include "clientversion.h"
#include "key.h"
#include "keystore.h"
#include "main.h"
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index 761210feac..67d50fccf4 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -4,12 +4,12 @@
#include "util.h"
+#include "clientversion.h"
#include "core/transaction.h"
#include "random.h"
#include "sync.h"
#include "utilstrencodings.h"
#include "utilmoneystr.h"
-#include "version.h"
#include <stdint.h>
#include <vector>
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index c042dd8467..d3d9cb8a01 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -5,6 +5,7 @@
#include "txmempool.h"
+#include "clientversion.h"
#include "streams.h"
#include "util.h"
#include "utilmoneystr.h"
diff --git a/src/version.h b/src/version.h
index a1e440de24..6ee08c205b 100644
--- a/src/version.h
+++ b/src/version.h
@@ -5,25 +5,6 @@
#ifndef BITCOIN_VERSION_H
#define BITCOIN_VERSION_H
-#include "clientversion.h"
-
-#include <string>
-#include <vector>
-
-//
-// client versioning
-//
-
-static const int CLIENT_VERSION =
- 1000000 * CLIENT_VERSION_MAJOR
- + 10000 * CLIENT_VERSION_MINOR
- + 100 * CLIENT_VERSION_REVISION
- + 1 * CLIENT_VERSION_BUILD;
-
-extern const std::string CLIENT_NAME;
-extern const std::string CLIENT_BUILD;
-extern const std::string CLIENT_DATE;
-
//
// network protocol versioning
//
@@ -53,7 +34,4 @@ static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version
static const int MEMPOOL_GD_VERSION = 60002;
-std::string FormatFullVersion();
-std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
-
#endif // BITCOIN_VERSION_H