MOVEONLY: Move versionbits info out of versionbits.o
This commit is contained in:
parent
920c090f63
commit
980b38f8a1
8 changed files with 44 additions and 24 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <utilstrencodings.h>
|
||||
#include <hash.h>
|
||||
#include <validationinterface.h>
|
||||
#include <versionbitsinfo.h>
|
||||
#include <warnings.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <utilstrencodings.h>
|
||||
#include <validation.h>
|
||||
#include <validationinterface.h>
|
||||
#include <versionbitsinfo.h>
|
||||
#include <warnings.h>
|
||||
|
||||
#include <memory>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
22
src/versionbitsinfo.cpp
Normal 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
17
src/versionbitsinfo.h
Normal 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
|
Loading…
Reference in a new issue