MOVEONLY: Move versionbits info out of versionbits.o

This commit is contained in:
Jorge Timón 2018-06-16 22:33:42 +02:00
parent 920c090f63
commit 980b38f8a1
No known key found for this signature in database
GPG key ID: A4F5D141C01A0387
8 changed files with 44 additions and 24 deletions

View file

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

View file

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

View file

@ -30,6 +30,7 @@
#include <utilstrencodings.h>
#include <hash.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>
#include <assert.h>

View file

@ -24,6 +24,7 @@
#include <utilstrencodings.h>
#include <validation.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>
#include <memory>

View file

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

View file

@ -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.
*/

22
src/versionbitsinfo.cpp Normal file
View file

@ -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,
}
};

17
src/versionbitsinfo.h Normal file
View file

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