Skip to content

Commit 7c12e8e

Browse files
authored
Merge pull request bnb-chain#2999 from karalabe/bury-blockchain-version
cmd, eth: drop the blockchain version from cli/eth configs
2 parents 0f6f83a + 3086049 commit 7c12e8e

4 files changed

Lines changed: 3 additions & 12 deletions

File tree

‎cmd/geth/main.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ participating.
133133
utils.BootnodesFlag,
134134
utils.DataDirFlag,
135135
utils.KeyStoreDirFlag,
136-
utils.BlockchainVersionFlag,
137136
utils.OlympicFlag,
138137
utils.FastSyncFlag,
139138
utils.CacheFlag,

‎cmd/geth/usage.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ var AppHelpFlagGroups = []flagGroup{
7474
utils.FastSyncFlag,
7575
utils.LightKDFFlag,
7676
utils.CacheFlag,
77-
utils.BlockchainVersionFlag,
7877
},
7978
},
8079
{

‎cmd/utils/flags.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ var (
146146
Usage: "Megabytes of memory allocated to internal caching (min 16MB / database forced)",
147147
Value: 128,
148148
}
149-
BlockchainVersionFlag = cli.IntFlag{
150-
Name: "blockchainversion",
151-
Usage: "Blockchain version (integer)",
152-
Value: core.BlockChainVersion,
153-
}
154149
FastSyncFlag = cli.BoolFlag{
155150
Name: "fast",
156151
Usage: "Enable fast syncing through state downloads",
@@ -681,7 +676,6 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) {
681676
Etherbase: MakeEtherbase(stack.AccountManager(), ctx),
682677
ChainConfig: MustMakeChainConfig(ctx),
683678
FastSync: ctx.GlobalBool(FastSyncFlag.Name),
684-
BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
685679
DatabaseCache: ctx.GlobalInt(CacheFlag.Name),
686680
DatabaseHandles: MakeDatabaseHandles(),
687681
NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),

‎eth/backend.go‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ type Config struct {
7070
Genesis string // Genesis JSON to seed the chain database with
7171
FastSync bool // Enables the state download based fast synchronisation algorithm
7272

73-
BlockChainVersion int
7473
SkipBcVersionCheck bool // e.g. blockchain export
7574
DatabaseCache int
7675
DatabaseHandles int
@@ -180,10 +179,10 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
180179

181180
if !config.SkipBcVersionCheck {
182181
bcVersion := core.GetBlockChainVersion(chainDb)
183-
if bcVersion != config.BlockChainVersion && bcVersion != 0 {
184-
return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d). Run geth upgradedb.\n", bcVersion, config.BlockChainVersion)
182+
if bcVersion != core.BlockChainVersion && bcVersion != 0 {
183+
return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d). Run geth upgradedb.\n", bcVersion, core.BlockChainVersion)
185184
}
186-
core.WriteBlockChainVersion(chainDb, config.BlockChainVersion)
185+
core.WriteBlockChainVersion(chainDb, core.BlockChainVersion)
187186
}
188187

189188
// load the genesis block or write a new one if no genesis

0 commit comments

Comments
 (0)