Skip to content

Commit 980b38f

Browse files
committed
MOVEONLY: Move versionbits info out of versionbits.o
1 parent 920c090 commit 980b38f

File tree

8 files changed

+44
-24
lines changed

8 files changed

+44
-24
lines changed

src/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ BITCOIN_CORE_H = \
187187
validation.h \
188188
validationinterface.h \
189189
versionbits.h \
190+
versionbitsinfo.h \
190191
walletinitinterface.h \
191192
wallet/coincontrol.h \
192193
wallet/crypter.h \
@@ -400,6 +401,7 @@ libbitcoin_common_a_SOURCES = \
400401
script/ismine.cpp \
401402
script/sign.cpp \
402403
script/standard.cpp \
404+
versionbitsinfo.cpp \
403405
warnings.cpp \
404406
$(BITCOIN_CORE_H)
405407

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <util.h>
4545
#include <utilmoneystr.h>
4646
#include <validationinterface.h>
47+
#include <versionbitsinfo.h>
4748
#include <warnings.h>
4849
#include <walletinitinterface.h>
4950
#include <stdint.h>

src/rpc/blockchain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <utilstrencodings.h>
3131
#include <hash.h>
3232
#include <validationinterface.h>
33+
#include <versionbitsinfo.h>
3334
#include <warnings.h>
3435

3536
#include <assert.h>

src/rpc/mining.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <utilstrencodings.h>
2525
#include <validation.h>
2626
#include <validationinterface.h>
27+
#include <versionbitsinfo.h>
2728
#include <warnings.h>
2829

2930
#include <memory>

src/versionbits.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@
55
#include <versionbits.h>
66
#include <consensus/params.h>
77

8-
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
9-
{
10-
/*.name =*/ "testdummy",
11-
/*.gbt_force =*/ true,
12-
},
13-
{
14-
/*.name =*/ "csv",
15-
/*.gbt_force =*/ true,
16-
},
17-
{
18-
/*.name =*/ "segwit",
19-
/*.gbt_force =*/ true,
20-
}
21-
};
22-
238
ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const
249
{
2510
int nPeriod = Period(params);

src/versionbits.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ enum class ThresholdState {
3030
// will either be nullptr or a block with (height + 1) % Period() == 0.
3131
typedef std::map<const CBlockIndex*, ThresholdState> ThresholdConditionCache;
3232

33-
struct VBDeploymentInfo {
34-
/** Deployment name */
35-
const char *name;
36-
/** Whether GBT clients can safely ignore this rule in simplified usage */
37-
bool gbt_force;
38-
};
39-
4033
struct BIP9Stats {
4134
int period;
4235
int threshold;
@@ -45,8 +38,6 @@ struct BIP9Stats {
4538
bool possible;
4639
};
4740

48-
extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];
49-
5041
/**
5142
* Abstract class that implements BIP9-style threshold logic, and caches results.
5243
*/

src/versionbitsinfo.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2016-2018 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#include <versionbitsinfo.h>
6+
7+
#include <consensus/params.h>
8+
9+
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
10+
{
11+
/*.name =*/ "testdummy",
12+
/*.gbt_force =*/ true,
13+
},
14+
{
15+
/*.name =*/ "csv",
16+
/*.gbt_force =*/ true,
17+
},
18+
{
19+
/*.name =*/ "segwit",
20+
/*.gbt_force =*/ true,
21+
}
22+
};

src/versionbitsinfo.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2016-2018 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#ifndef BITCOIN_VERSIONBITSINFO_H
6+
#define BITCOIN_VERSIONBITSINFO_H
7+
8+
struct VBDeploymentInfo {
9+
/** Deployment name */
10+
const char *name;
11+
/** Whether GBT clients can safely ignore this rule in simplified usage */
12+
bool gbt_force;
13+
};
14+
15+
extern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];
16+
17+
#endif // BITCOIN_VERSIONBITSINFO_H

0 commit comments

Comments
 (0)