diff options
author | Jorge Timón <jtimon@jtimon.cc> | 2018-06-16 22:33:42 +0200 |
---|---|---|
committer | Jorge Timón <jtimon@jtimon.cc> | 2018-09-23 22:55:11 +0200 |
commit | 980b38f8a12130d2761d0f748db750165cfed025 (patch) | |
tree | f5eb758ca0fb57d70fc3606c85a60d20ae057951 | |
parent | 920c090f63f4990bf0f3b3d1a6d3d8a8bcd14ba0 (diff) |
MOVEONLY: Move versionbits info out of versionbits.o
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/init.cpp | 1 | ||||
-rw-r--r-- | src/rpc/blockchain.cpp | 1 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 1 | ||||
-rw-r--r-- | src/versionbits.cpp | 15 | ||||
-rw-r--r-- | src/versionbits.h | 9 | ||||
-rw-r--r-- | src/versionbitsinfo.cpp | 22 | ||||
-rw-r--r-- | src/versionbitsinfo.h | 17 |
8 files changed, 44 insertions, 24 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index f7d7a5d377..a1b9b4cb82 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -187,6 +187,7 @@ BITCOIN_CORE_H = \ validation.h \ validationinterface.h \ versionbits.h \ + versionbitsinfo.h \ walletinitinterface.h \ wallet/coincontrol.h \ wallet/crypter.h \ @@ -400,6 +401,7 @@ libbitcoin_common_a_SOURCES = \ script/ismine.cpp \ script/sign.cpp \ script/standard.cpp \ + versionbitsinfo.cpp \ warnings.cpp \ $(BITCOIN_CORE_H) diff --git a/src/init.cpp b/src/init.cpp index d10edbd8b6..bb23748d82 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -44,6 +44,7 @@ #include <util.h> #include <utilmoneystr.h> #include <validationinterface.h> +#include <versionbitsinfo.h> #include <warnings.h> #include <walletinitinterface.h> #include <stdint.h> diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 439427cd7e..073ab8b1b1 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -30,6 +30,7 @@ #include <utilstrencodings.h> #include <hash.h> #include <validationinterface.h> +#include <versionbitsinfo.h> #include <warnings.h> #include <assert.h> diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index b1bea85fef..3eac8a1016 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -24,6 +24,7 @@ #include <utilstrencodings.h> #include <validation.h> #include <validationinterface.h> +#include <versionbitsinfo.h> #include <warnings.h> #include <memory> diff --git a/src/versionbits.cpp b/src/versionbits.cpp index b0d2bc8a14..3f297c0ebb 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -5,21 +5,6 @@ #include <versionbits.h> #include <consensus/params.h> -const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = { - { - /*.name =*/ "testdummy", - /*.gbt_force =*/ true, - }, - { - /*.name =*/ "csv", - /*.gbt_force =*/ true, - }, - { - /*.name =*/ "segwit", - /*.gbt_force =*/ true, - } -}; - ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const { int nPeriod = Period(params); diff --git a/src/versionbits.h b/src/versionbits.h index e4bf9cb9be..cdc947cd9e 100644 --- a/src/versionbits.h +++ b/src/versionbits.h @@ -30,13 +30,6 @@ enum class ThresholdState { // will either be nullptr or a block with (height + 1) % Period() == 0. typedef std::map<const CBlockIndex*, ThresholdState> ThresholdConditionCache; -struct VBDeploymentInfo { - /** Deployment name */ - const char *name; - /** Whether GBT clients can safely ignore this rule in simplified usage */ - bool gbt_force; -}; - struct BIP9Stats { int period; int threshold; @@ -45,8 +38,6 @@ struct BIP9Stats { bool possible; }; -extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[]; - /** * Abstract class that implements BIP9-style threshold logic, and caches results. */ diff --git a/src/versionbitsinfo.cpp b/src/versionbitsinfo.cpp new file mode 100644 index 0000000000..ecf3482927 --- /dev/null +++ b/src/versionbitsinfo.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2016-2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include <versionbitsinfo.h> + +#include <consensus/params.h> + +const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = { + { + /*.name =*/ "testdummy", + /*.gbt_force =*/ true, + }, + { + /*.name =*/ "csv", + /*.gbt_force =*/ true, + }, + { + /*.name =*/ "segwit", + /*.gbt_force =*/ true, + } +}; diff --git a/src/versionbitsinfo.h b/src/versionbitsinfo.h new file mode 100644 index 0000000000..a7822bc747 --- /dev/null +++ b/src/versionbitsinfo.h @@ -0,0 +1,17 @@ +// Copyright (c) 2016-2018 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_VERSIONBITSINFO_H +#define BITCOIN_VERSIONBITSINFO_H + +struct VBDeploymentInfo { + /** Deployment name */ + const char *name; + /** Whether GBT clients can safely ignore this rule in simplified usage */ + bool gbt_force; +}; + +extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[]; + +#endif // BITCOIN_VERSIONBITSINFO_H |