Skip to content

Commit

Permalink
MOVEONLY: Move versionbits info out of versionbits.o
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimon committed Sep 23, 2018
1 parent 920c090 commit 980b38f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 24 deletions.
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ BITCOIN_CORE_H = \
validation.h \
validationinterface.h \
versionbits.h \
versionbitsinfo.h \
walletinitinterface.h \
wallet/coincontrol.h \
wallet/crypter.h \
Expand Down Expand Up @@ -400,6 +401,7 @@ libbitcoin_common_a_SOURCES = \
script/ismine.cpp \
script/sign.cpp \
script/standard.cpp \
versionbitsinfo.cpp \
warnings.cpp \
$(BITCOIN_CORE_H)

Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <utilstrencodings.h>
#include <hash.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>

#include <assert.h>
Expand Down
1 change: 1 addition & 0 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <utilstrencodings.h>
#include <validation.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>

#include <memory>
Expand Down
15 changes: 0 additions & 15 deletions src/versionbits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions src/versionbits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -45,8 +38,6 @@ struct BIP9Stats {
bool possible;
};

extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];

/**
* Abstract class that implements BIP9-style threshold logic, and caches results.
*/
Expand Down
22 changes: 22 additions & 0 deletions src/versionbitsinfo.cpp
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions src/versionbitsinfo.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 980b38f

Please sign in to comment.