From fa98a097a30bc39f2424c0efd28a7979155faae6 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 28 Nov 2023 17:56:26 +0100 Subject: Rename version.h to node/protocol_version.h --- src/Makefile.am | 4 ++-- src/net.h | 2 +- src/node/protocol_version.h | 38 ++++++++++++++++++++++++++++++++++ src/rpc/net.cpp | 2 +- src/test/fuzz/util/net.cpp | 2 +- src/test/net_peer_connection_tests.cpp | 2 +- src/test/net_tests.cpp | 2 +- src/version.h | 38 ---------------------------------- 8 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 src/node/protocol_version.h delete mode 100644 src/version.h diff --git a/src/Makefile.am b/src/Makefile.am index 99b2184cf2..27f947d7a5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -230,6 +230,7 @@ BITCOIN_CORE_H = \ node/mini_miner.h \ node/minisketchwrapper.h \ node/peerman_args.h \ + node/protocol_version.h \ node/psbt.h \ node/transaction.h \ node/txreconciliation.h \ @@ -658,8 +659,7 @@ libbitcoin_consensus_a_SOURCES = \ uint256.cpp \ uint256.h \ util/strencodings.cpp \ - util/strencodings.h \ - version.h + util/strencodings.h # # common # diff --git a/src/net.h b/src/net.h index 4347bf12ca..28f304b062 100644 --- a/src/net.h +++ b/src/net.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/src/node/protocol_version.h b/src/node/protocol_version.h new file mode 100644 index 0000000000..43c1bf6c5b --- /dev/null +++ b/src/node/protocol_version.h @@ -0,0 +1,38 @@ +// Copyright (c) 2012-present The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_NODE_PROTOCOL_VERSION_H +#define BITCOIN_NODE_PROTOCOL_VERSION_H + +/** + * network protocol versioning + */ + +static const int PROTOCOL_VERSION = 70016; + +//! initial proto version, to be increased after version/verack negotiation +static const int INIT_PROTO_VERSION = 209; + +//! disconnect from peers older than this proto version +static const int MIN_PEER_PROTO_VERSION = 31800; + +//! BIP 0031, pong message, is enabled for all versions AFTER this one +static const int BIP0031_VERSION = 60000; + +//! "sendheaders" command and announcing blocks with headers starts with this version +static const int SENDHEADERS_VERSION = 70012; + +//! "feefilter" tells peers to filter invs to you by fee starts with this version +static const int FEEFILTER_VERSION = 70013; + +//! short-id-based block download starts with this version +static const int SHORT_IDS_BLOCKS_VERSION = 70014; + +//! not banning for invalid compact blocks starts with this version +static const int INVALID_CB_NO_BAN_VERSION = 70015; + +//! "wtxidrelay" command for wtxid-based relay starts with this version +static const int WTXID_RELAY_VERSION = 70016; + +#endif // BITCOIN_NODE_PROTOCOL_VERSION_H diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index c631132df2..5fea8c22c9 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -15,6 +15,7 @@ #include // For banmap_t #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/src/test/fuzz/util/net.cpp b/src/test/fuzz/util/net.cpp index 5a286c05d2..eb0f14ede0 100644 --- a/src/test/fuzz/util/net.cpp +++ b/src/test/fuzz/util/net.cpp @@ -6,13 +6,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/test/net_peer_connection_tests.cpp b/src/test/net_peer_connection_tests.cpp index 0300c17e40..58cbe9eb72 100644 --- a/src/test/net_peer_connection_tests.cpp +++ b/src/test/net_peer_connection_tests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 0274ccaba1..70a8279f04 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include diff --git a/src/version.h b/src/version.h deleted file mode 100644 index c2ebeecbfb..0000000000 --- a/src/version.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2012-2020 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_VERSION_H -#define BITCOIN_VERSION_H - -/** - * network protocol versioning - */ - -static const int PROTOCOL_VERSION = 70016; - -//! initial proto version, to be increased after version/verack negotiation -static const int INIT_PROTO_VERSION = 209; - -//! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 31800; - -//! BIP 0031, pong message, is enabled for all versions AFTER this one -static const int BIP0031_VERSION = 60000; - -//! "sendheaders" command and announcing blocks with headers starts with this version -static const int SENDHEADERS_VERSION = 70012; - -//! "feefilter" tells peers to filter invs to you by fee starts with this version -static const int FEEFILTER_VERSION = 70013; - -//! short-id-based block download starts with this version -static const int SHORT_IDS_BLOCKS_VERSION = 70014; - -//! not banning for invalid compact blocks starts with this version -static const int INVALID_CB_NO_BAN_VERSION = 70015; - -//! "wtxidrelay" command for wtxid-based relay starts with this version -static const int WTXID_RELAY_VERSION = 70016; - -#endif // BITCOIN_VERSION_H -- cgit v1.2.3