Skip to content

Commit 71697f9

Browse files
committed
Separate protocol versioning from clientversion
1 parent 723c752 commit 71697f9

25 files changed

+52
-32
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
src/version.cpp export-subst
1+
src/clientversion.cpp export-subst

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
3636
dist-hook:
3737
-$(MAKE) -C $(top_distdir)/src/leveldb clean
3838
-$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
39-
-$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf -
39+
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
4040

4141
distcheck-hook:
4242
$(MKDIR_P) $(top_distdir)/_build/src/leveldb

src/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ obj/build.h: FORCE
146146
@$(MKDIR_P) $(builddir)/obj
147147
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
148148
$(abs_top_srcdir)
149-
libbitcoin_util_a-version.$(OBJEXT): obj/build.h
149+
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
150150

151151
# server: shared between bitcoind and bitcoin-qt
152152
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
@@ -241,6 +241,7 @@ libbitcoin_util_a_SOURCES = \
241241
compat/glibc_sanity.cpp \
242242
compat/glibcxx_sanity.cpp \
243243
chainparamsbase.cpp \
244+
clientversion.cpp \
244245
random.cpp \
245246
rpcprotocol.cpp \
246247
sync.cpp \
@@ -249,7 +250,6 @@ libbitcoin_util_a_SOURCES = \
249250
utilstrencodings.cpp \
250251
utilmoneystr.cpp \
251252
utiltime.cpp \
252-
version.cpp \
253253
$(BITCOIN_CORE_H)
254254

255255
if GLIBC_BACK_COMPAT
@@ -354,7 +354,7 @@ clean-local:
354354

355355
.rc.o:
356356
@test -f $(WINDRES)
357-
$(AM_V_GEN) $(WINDRES) -i $< -o $@
357+
$(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
358358

359359
.mm.o:
360360
$(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \

src/alert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "alert.h"
77

88
#include "chainparams.h"
9+
#include "clientversion.h"
910
#include "key.h"
1011
#include "net.h"
1112
#include "timedata.h"

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
#include "chainparamsbase.h"
7+
#include "clientversion.h"
78
#include "init.h"
89
#include "rpcclient.h"
910
#include "rpcprotocol.h"
1011
#include "util.h"
1112
#include "utilstrencodings.h"
12-
#include "version.h"
1313

1414
#include <boost/filesystem/operations.hpp>
1515

src/bitcoin-tx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include "base58.h"
6+
#include "clientversion.h"
67
#include "core/transaction.h"
78
#include "core_io.h"
89
#include "keystore.h"

src/bitcoind.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Distributed under the MIT/X11 software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6+
#include "clientversion.h"
67
#include "rpcserver.h"
78
#include "init.h"
89
#include "main.h"

src/version.cpp renamed to src/clientversion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include "version.h"
5+
#include "clientversion.h"
66

77
#include "tinyformat.h"
88

src/clientversion.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,31 @@
3535
// Copyright string used in Windows .rc files
3636
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers"
3737

38+
/*
39+
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
40+
WINDRES_PREPROC is defined to indicate that its pre-processor is running.
41+
Anything other than a define should be guarded below.
42+
*/
43+
44+
#if !defined(WINDRES_PREPROC)
45+
46+
#include <string>
47+
#include <vector>
48+
49+
static const int CLIENT_VERSION =
50+
1000000 * CLIENT_VERSION_MAJOR
51+
+ 10000 * CLIENT_VERSION_MINOR
52+
+ 100 * CLIENT_VERSION_REVISION
53+
+ 1 * CLIENT_VERSION_BUILD;
54+
55+
extern const std::string CLIENT_NAME;
56+
extern const std::string CLIENT_BUILD;
57+
extern const std::string CLIENT_DATE;
58+
59+
60+
std::string FormatFullVersion();
61+
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
62+
63+
#endif // WINDRES_PREPROC
64+
3865
#endif // CLIENTVERSION_H

src/db.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef BITCOIN_DB_H
77
#define BITCOIN_DB_H
88

9+
#include "clientversion.h"
910
#include "serialize.h"
1011
#include "streams.h"
1112
#include "sync.h"

0 commit comments

Comments
 (0)