Browse Source

Separate protocol versioning from clientversion

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

+ 1
- 1
.gitattributes View File

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

+ 1
- 1
Makefile.am View File

@ -36,7 +36,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
dist-hook:
-$(MAKE) -C $(top_distdir)/src/leveldb clean
-$(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:
$(MKDIR_P) $(top_distdir)/_build/src/leveldb


+ 3
- 3
src/Makefile.am View File

@ -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) \


+ 1
- 0
src/alert.cpp View File

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


+ 1
- 1
src/bitcoin-cli.cpp View File

@ -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>


+ 1
- 0
src/bitcoin-tx.cpp View File

@ -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"


+ 1
- 0
src/bitcoind.cpp View File

@ -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"


src/version.cpp → src/clientversion.cpp View File

@ -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"

+ 27
- 0
src/clientversion.h View File

@ -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

+ 1
- 0
src/db.h View File

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


+ 1
- 0
src/leveldbwrapper.h View File

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


+ 1
- 0
src/net.cpp View File

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


+ 1
- 0
src/qt/clientmodel.cpp View File

@ -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"


+ 1
- 0
src/qt/recentrequeststablemodel.cpp View File

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


+ 1
- 1
src/qt/utilitydialog.cpp View File

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


+ 1
- 0
src/rpcmisc.cpp View File

@ -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"


+ 1
- 0
src/rpcnet.cpp View File

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


+ 1
- 0
src/rpcprotocol.cpp View File

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


+ 1
- 1
src/test/alert_tests.cpp View File

@ -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>


+ 1
- 0
src/test/bloom_tests.cpp View File

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


+ 1
- 0
src/test/checkblock_tests.cpp View File

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


+ 1
- 0
src/test/transaction_tests.cpp View File

@ -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"


+ 1
- 1
src/test/util_tests.cpp View File

@ -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>


+ 1
- 0
src/txmempool.cpp View File

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


+ 0
- 22
src/version.h View File

@ -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

Loading…
Cancel
Save