mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 21:07:17 +00:00
Merge pull request #2999 from karalabe/bury-blockchain-version
cmd, eth: drop the blockchain version from cli/eth configs
This commit is contained in:
commit
7c12e8ea44
@ -133,7 +133,6 @@ participating.
|
|||||||
utils.BootnodesFlag,
|
utils.BootnodesFlag,
|
||||||
utils.DataDirFlag,
|
utils.DataDirFlag,
|
||||||
utils.KeyStoreDirFlag,
|
utils.KeyStoreDirFlag,
|
||||||
utils.BlockchainVersionFlag,
|
|
||||||
utils.OlympicFlag,
|
utils.OlympicFlag,
|
||||||
utils.FastSyncFlag,
|
utils.FastSyncFlag,
|
||||||
utils.CacheFlag,
|
utils.CacheFlag,
|
||||||
|
@ -74,7 +74,6 @@ var AppHelpFlagGroups = []flagGroup{
|
|||||||
utils.FastSyncFlag,
|
utils.FastSyncFlag,
|
||||||
utils.LightKDFFlag,
|
utils.LightKDFFlag,
|
||||||
utils.CacheFlag,
|
utils.CacheFlag,
|
||||||
utils.BlockchainVersionFlag,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -146,11 +146,6 @@ var (
|
|||||||
Usage: "Megabytes of memory allocated to internal caching (min 16MB / database forced)",
|
Usage: "Megabytes of memory allocated to internal caching (min 16MB / database forced)",
|
||||||
Value: 128,
|
Value: 128,
|
||||||
}
|
}
|
||||||
BlockchainVersionFlag = cli.IntFlag{
|
|
||||||
Name: "blockchainversion",
|
|
||||||
Usage: "Blockchain version (integer)",
|
|
||||||
Value: core.BlockChainVersion,
|
|
||||||
}
|
|
||||||
FastSyncFlag = cli.BoolFlag{
|
FastSyncFlag = cli.BoolFlag{
|
||||||
Name: "fast",
|
Name: "fast",
|
||||||
Usage: "Enable fast syncing through state downloads",
|
Usage: "Enable fast syncing through state downloads",
|
||||||
@ -681,7 +676,6 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) {
|
|||||||
Etherbase: MakeEtherbase(stack.AccountManager(), ctx),
|
Etherbase: MakeEtherbase(stack.AccountManager(), ctx),
|
||||||
ChainConfig: MustMakeChainConfig(ctx),
|
ChainConfig: MustMakeChainConfig(ctx),
|
||||||
FastSync: ctx.GlobalBool(FastSyncFlag.Name),
|
FastSync: ctx.GlobalBool(FastSyncFlag.Name),
|
||||||
BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
|
|
||||||
DatabaseCache: ctx.GlobalInt(CacheFlag.Name),
|
DatabaseCache: ctx.GlobalInt(CacheFlag.Name),
|
||||||
DatabaseHandles: MakeDatabaseHandles(),
|
DatabaseHandles: MakeDatabaseHandles(),
|
||||||
NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
|
NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
|
||||||
|
@ -70,7 +70,6 @@ type Config struct {
|
|||||||
Genesis string // Genesis JSON to seed the chain database with
|
Genesis string // Genesis JSON to seed the chain database with
|
||||||
FastSync bool // Enables the state download based fast synchronisation algorithm
|
FastSync bool // Enables the state download based fast synchronisation algorithm
|
||||||
|
|
||||||
BlockChainVersion int
|
|
||||||
SkipBcVersionCheck bool // e.g. blockchain export
|
SkipBcVersionCheck bool // e.g. blockchain export
|
||||||
DatabaseCache int
|
DatabaseCache int
|
||||||
DatabaseHandles int
|
DatabaseHandles int
|
||||||
@ -180,10 +179,10 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
|||||||
|
|
||||||
if !config.SkipBcVersionCheck {
|
if !config.SkipBcVersionCheck {
|
||||||
bcVersion := core.GetBlockChainVersion(chainDb)
|
bcVersion := core.GetBlockChainVersion(chainDb)
|
||||||
if bcVersion != config.BlockChainVersion && bcVersion != 0 {
|
if bcVersion != core.BlockChainVersion && bcVersion != 0 {
|
||||||
return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d). Run geth upgradedb.\n", bcVersion, config.BlockChainVersion)
|
return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d). Run geth upgradedb.\n", bcVersion, core.BlockChainVersion)
|
||||||
}
|
}
|
||||||
core.WriteBlockChainVersion(chainDb, config.BlockChainVersion)
|
core.WriteBlockChainVersion(chainDb, core.BlockChainVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// load the genesis block or write a new one if no genesis
|
// load the genesis block or write a new one if no genesis
|
||||||
|
Loading…
Reference in New Issue
Block a user