|
|
@ -38,7 +38,6 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common/fdlimit" |
|
|
|
"github.com/ethereum/go-ethereum/common/fdlimit" |
|
|
|
"github.com/ethereum/go-ethereum/consensus" |
|
|
|
"github.com/ethereum/go-ethereum/consensus" |
|
|
|
"github.com/ethereum/go-ethereum/consensus/clique" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/consensus/ethash" |
|
|
|
"github.com/ethereum/go-ethereum/consensus/ethash" |
|
|
|
"github.com/ethereum/go-ethereum/core" |
|
|
|
"github.com/ethereum/go-ethereum/core" |
|
|
|
"github.com/ethereum/go-ethereum/core/rawdb" |
|
|
|
"github.com/ethereum/go-ethereum/core/rawdb" |
|
|
@ -1968,24 +1967,13 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
Fatalf("%v", err) |
|
|
|
Fatalf("%v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var engine consensus.Engine |
|
|
|
var engine consensus.Engine |
|
|
|
if config.Clique != nil { |
|
|
|
ethashConf := ethconfig.Defaults.Ethash |
|
|
|
engine = clique.New(config.Clique, chainDb) |
|
|
|
if ctx.GlobalBool(FakePoWFlag.Name) { |
|
|
|
} else { |
|
|
|
ethashConf.PowMode = ethash.ModeFake |
|
|
|
engine = ethash.NewFaker() |
|
|
|
|
|
|
|
if !ctx.GlobalBool(FakePoWFlag.Name) { |
|
|
|
|
|
|
|
engine = ethash.New(ethash.Config{ |
|
|
|
|
|
|
|
CacheDir: stack.ResolvePath(ethconfig.Defaults.Ethash.CacheDir), |
|
|
|
|
|
|
|
CachesInMem: ethconfig.Defaults.Ethash.CachesInMem, |
|
|
|
|
|
|
|
CachesOnDisk: ethconfig.Defaults.Ethash.CachesOnDisk, |
|
|
|
|
|
|
|
CachesLockMmap: ethconfig.Defaults.Ethash.CachesLockMmap, |
|
|
|
|
|
|
|
DatasetDir: stack.ResolvePath(ethconfig.Defaults.Ethash.DatasetDir), |
|
|
|
|
|
|
|
DatasetsInMem: ethconfig.Defaults.Ethash.DatasetsInMem, |
|
|
|
|
|
|
|
DatasetsOnDisk: ethconfig.Defaults.Ethash.DatasetsOnDisk, |
|
|
|
|
|
|
|
DatasetsLockMmap: ethconfig.Defaults.Ethash.DatasetsLockMmap, |
|
|
|
|
|
|
|
}, nil, false) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
engine = ethconfig.CreateConsensusEngine(stack, config, ðashConf, nil, false, chainDb) |
|
|
|
if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" { |
|
|
|
if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" { |
|
|
|
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name) |
|
|
|
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name) |
|
|
|
} |
|
|
|
} |
|
|
|