Browse Source

Separate protocol versioning from clientversion

0.10
Cory Fields 10 years ago
parent
commit
71697f97d3
  1. 2
      .gitattributes
  2. 2
      Makefile.am
  3. 6
      src/Makefile.am
  4. 1
      src/alert.cpp
  5. 2
      src/bitcoin-cli.cpp
  6. 1
      src/bitcoin-tx.cpp
  7. 1
      src/bitcoind.cpp
  8. 2
      src/clientversion.cpp
  9. 27
      src/clientversion.h
  10. 1
      src/db.h
  11. 1
      src/leveldbwrapper.h
  12. 1
      src/net.cpp
  13. 1
      src/qt/clientmodel.cpp
  14. 1
      src/qt/recentrequeststablemodel.cpp
  15. 2
      src/qt/utilitydialog.cpp
  16. 1
      src/rpcmisc.cpp
  17. 1
      src/rpcnet.cpp
  18. 1
      src/rpcprotocol.cpp
  19. 2
      src/test/alert_tests.cpp
  20. 1
      src/test/bloom_tests.cpp
  21. 1
      src/test/checkblock_tests.cpp
  22. 1
      src/test/transaction_tests.cpp
  23. 2
      src/test/util_tests.cpp
  24. 1
      src/txmempool.cpp
  25. 22
      src/version.h

2
.gitattributes vendored

@ -1 +1 @@
src/version.cpp export-subst src/clientversion.cpp export-subst

2
Makefile.am

@ -36,7 +36,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
dist-hook: dist-hook:
-$(MAKE) -C $(top_distdir)/src/leveldb clean -$(MAKE) -C $(top_distdir)/src/leveldb clean
-$(MAKE) -C $(top_distdir)/src/secp256k1 distclean -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
-$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf - -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
distcheck-hook: distcheck-hook:
$(MKDIR_P) $(top_distdir)/_build/src/leveldb $(MKDIR_P) $(top_distdir)/_build/src/leveldb

6
src/Makefile.am

@ -146,7 +146,7 @@ obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj @$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
$(abs_top_srcdir) $(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 # server: shared between bitcoind and bitcoin-qt
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
@ -241,6 +241,7 @@ libbitcoin_util_a_SOURCES = \
compat/glibc_sanity.cpp \ compat/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \ compat/glibcxx_sanity.cpp \
chainparamsbase.cpp \ chainparamsbase.cpp \
clientversion.cpp \
random.cpp \ random.cpp \
rpcprotocol.cpp \ rpcprotocol.cpp \
sync.cpp \ sync.cpp \
@ -249,7 +250,6 @@ libbitcoin_util_a_SOURCES = \
utilstrencodings.cpp \ utilstrencodings.cpp \
utilmoneystr.cpp \ utilmoneystr.cpp \
utiltime.cpp \ utiltime.cpp \
version.cpp \
$(BITCOIN_CORE_H) $(BITCOIN_CORE_H)
if GLIBC_BACK_COMPAT if GLIBC_BACK_COMPAT
@ -354,7 +354,7 @@ clean-local:
.rc.o: .rc.o:
@test -f $(WINDRES) @test -f $(WINDRES)
$(AM_V_GEN) $(WINDRES) -i $< -o $@ $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
.mm.o: .mm.o:
$(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \

1
src/alert.cpp

@ -6,6 +6,7 @@
#include "alert.h" #include "alert.h"
#include "chainparams.h" #include "chainparams.h"
#include "clientversion.h"
#include "key.h" #include "key.h"
#include "net.h" #include "net.h"
#include "timedata.h" #include "timedata.h"

2
src/bitcoin-cli.cpp

@ -4,12 +4,12 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparamsbase.h" #include "chainparamsbase.h"
#include "clientversion.h"
#include "init.h" #include "init.h"
#include "rpcclient.h" #include "rpcclient.h"
#include "rpcprotocol.h" #include "rpcprotocol.h"
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include "version.h"
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>

1
src/bitcoin-tx.cpp

@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h" #include "base58.h"
#include "clientversion.h"
#include "core/transaction.h" #include "core/transaction.h"
#include "core_io.h" #include "core_io.h"
#include "keystore.h" #include "keystore.h"

1
src/bitcoind.cpp

@ -3,6 +3,7 @@
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "clientversion.h"
#include "rpcserver.h" #include "rpcserver.h"
#include "init.h" #include "init.h"
#include "main.h" #include "main.h"

2
src/version.cpp → src/clientversion.cpp

@ -2,7 +2,7 @@
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "version.h" #include "clientversion.h"
#include "tinyformat.h" #include "tinyformat.h"

27
src/clientversion.h

@ -35,4 +35,31 @@
// Copyright string used in Windows .rc files // Copyright string used in Windows .rc files
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" #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 #endif // CLIENTVERSION_H

1
src/db.h

@ -6,6 +6,7 @@
#ifndef BITCOIN_DB_H #ifndef BITCOIN_DB_H
#define BITCOIN_DB_H #define BITCOIN_DB_H
#include "clientversion.h"
#include "serialize.h" #include "serialize.h"
#include "streams.h" #include "streams.h"
#include "sync.h" #include "sync.h"

1
src/leveldbwrapper.h

@ -5,6 +5,7 @@
#ifndef BITCOIN_LEVELDBWRAPPER_H #ifndef BITCOIN_LEVELDBWRAPPER_H
#define BITCOIN_LEVELDBWRAPPER_H #define BITCOIN_LEVELDBWRAPPER_H
#include "clientversion.h"
#include "serialize.h" #include "serialize.h"
#include "streams.h" #include "streams.h"
#include "util.h" #include "util.h"

1
src/net.cpp

@ -11,6 +11,7 @@
#include "addrman.h" #include "addrman.h"
#include "chainparams.h" #include "chainparams.h"
#include "clientversion.h"
#include "core/transaction.h" #include "core/transaction.h"
#include "ui_interface.h" #include "ui_interface.h"

1
src/qt/clientmodel.cpp

@ -10,6 +10,7 @@
#include "alert.h" #include "alert.h"
#include "chainparams.h" #include "chainparams.h"
#include "checkpoints.h" #include "checkpoints.h"
#include "clientversion.h"
#include "main.h" #include "main.h"
#include "net.h" #include "net.h"
#include "ui_interface.h" #include "ui_interface.h"

1
src/qt/recentrequeststablemodel.cpp

@ -5,6 +5,7 @@
#include "recentrequeststablemodel.h" #include "recentrequeststablemodel.h"
#include "bitcoinunits.h" #include "bitcoinunits.h"
#include "clientversion.h"
#include "guiutil.h" #include "guiutil.h"
#include "optionsmodel.h" #include "optionsmodel.h"
#include "streams.h" #include "streams.h"

2
src/qt/utilitydialog.cpp

@ -10,8 +10,8 @@
#include "clientmodel.h" #include "clientmodel.h"
#include "guiutil.h" #include "guiutil.h"
#include "clientversion.h"
#include "init.h" #include "init.h"
#include "version.h"
#include <stdio.h> #include <stdio.h>

1
src/rpcmisc.cpp

@ -4,6 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h" #include "base58.h"
#include "clientversion.h"
#include "init.h" #include "init.h"
#include "main.h" #include "main.h"
#include "net.h" #include "net.h"

1
src/rpcnet.cpp

@ -4,6 +4,7 @@
#include "rpcserver.h" #include "rpcserver.h"
#include "clientversion.h"
#include "main.h" #include "main.h"
#include "net.h" #include "net.h"
#include "netbase.h" #include "netbase.h"

1
src/rpcprotocol.cpp

@ -5,6 +5,7 @@
#include "rpcprotocol.h" #include "rpcprotocol.h"
#include "clientversion.h"
#include "tinyformat.h" #include "tinyformat.h"
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"

2
src/test/alert_tests.cpp

@ -7,13 +7,13 @@
// //
#include "alert.h" #include "alert.h"
#include "clientversion.h"
#include "data/alertTests.raw.h" #include "data/alertTests.raw.h"
#include "serialize.h" #include "serialize.h"
#include "streams.h" #include "streams.h"
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include "version.h"
#include <fstream> #include <fstream>

1
src/test/bloom_tests.cpp

@ -5,6 +5,7 @@
#include "bloom.h" #include "bloom.h"
#include "base58.h" #include "base58.h"
#include "clientversion.h"
#include "key.h" #include "key.h"
#include "main.h" #include "main.h"
#include "serialize.h" #include "serialize.h"

1
src/test/checkblock_tests.cpp

@ -8,6 +8,7 @@
#include "clientversion.h"
#include "main.h" #include "main.h"
#include "utiltime.h" #include "utiltime.h"

1
src/test/transaction_tests.cpp

@ -5,6 +5,7 @@
#include "data/tx_invalid.json.h" #include "data/tx_invalid.json.h"
#include "data/tx_valid.json.h" #include "data/tx_valid.json.h"
#include "clientversion.h"
#include "key.h" #include "key.h"
#include "keystore.h" #include "keystore.h"
#include "main.h" #include "main.h"

2
src/test/util_tests.cpp

@ -4,12 +4,12 @@
#include "util.h" #include "util.h"
#include "clientversion.h"
#include "core/transaction.h" #include "core/transaction.h"
#include "random.h" #include "random.h"
#include "sync.h" #include "sync.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include "utilmoneystr.h" #include "utilmoneystr.h"
#include "version.h"
#include <stdint.h> #include <stdint.h>
#include <vector> #include <vector>

1
src/txmempool.cpp

@ -5,6 +5,7 @@
#include "txmempool.h" #include "txmempool.h"
#include "clientversion.h"
#include "streams.h" #include "streams.h"
#include "util.h" #include "util.h"
#include "utilmoneystr.h" #include "utilmoneystr.h"

22
src/version.h

@ -5,25 +5,6 @@
#ifndef BITCOIN_VERSION_H #ifndef BITCOIN_VERSION_H
#define 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 // network protocol versioning
// //
@ -53,7 +34,4 @@ static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version // "mempool" command, enhanced "getdata" behavior starts with this version
static const int MEMPOOL_GD_VERSION = 60002; 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 #endif // BITCOIN_VERSION_H

Loading…
Cancel
Save