mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
fix : flags, FLOCK lock
This commit is contained in:
parent
65014b1f5e
commit
fcd5002b6b
3 changed files with 23 additions and 5 deletions
|
|
@ -531,7 +531,7 @@ func NewParallelBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis
|
|||
}
|
||||
|
||||
// Open trie database with provided config
|
||||
triedb := trie.NewDatabase(db, cacheConfig.triedbConfig())
|
||||
triedb := bc.triedb
|
||||
|
||||
chainConfig, _, genesisErr := SetupGenesisBlockWithOverride(db, triedb, genesis, overrides)
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ type Config struct {
|
|||
// GcMode selects the garbage collection mode for the trie
|
||||
GcMode string `hcl:"gcmode,optional" toml:"gcmode,optional"`
|
||||
|
||||
// state.scheme selects the Scheme to use for storing ethereum state ('hash' or 'path')
|
||||
StateScheme string `hcl:"state.scheme,optional" toml:"state.scheme,optional"`
|
||||
|
||||
// Snapshot enables the snapshot database mode
|
||||
Snapshot bool `hcl:"snapshot,optional" toml:"snapshot,optional"`
|
||||
|
||||
|
|
@ -638,10 +641,11 @@ func DefaultConfig() *Config {
|
|||
Without: false,
|
||||
GRPCAddress: "",
|
||||
},
|
||||
SyncMode: "full",
|
||||
GcMode: "full",
|
||||
Snapshot: true,
|
||||
BorLogs: false,
|
||||
SyncMode: "full",
|
||||
GcMode: "full",
|
||||
StateScheme: "hash",
|
||||
Snapshot: true,
|
||||
BorLogs: false,
|
||||
TxPool: &TxPoolConfig{
|
||||
Locals: []string{},
|
||||
NoLocals: false,
|
||||
|
|
@ -1164,6 +1168,14 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
|
|||
return nil, fmt.Errorf("gcmode '%s' not found", c.GcMode)
|
||||
}
|
||||
|
||||
// statescheme "hash" or "path"
|
||||
switch c.StateScheme {
|
||||
case "path":
|
||||
n.StateScheme = "path"
|
||||
default:
|
||||
n.StateScheme = "hash"
|
||||
}
|
||||
|
||||
// snapshot disable check
|
||||
if !c.Snapshot {
|
||||
if n.SyncMode == downloader.SnapSync {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,12 @@ func (c *Command) Flags(config *Config) *flagset.Flagset {
|
|||
Value: &c.cliConfig.GcMode,
|
||||
Default: c.cliConfig.GcMode,
|
||||
})
|
||||
f.StringFlag(&flagset.StringFlag{
|
||||
Name: "state.scheme",
|
||||
Usage: "Scheme to use for storing ethereum state ('hash' or 'path')",
|
||||
Value: &c.cliConfig.StateScheme,
|
||||
Default: c.cliConfig.StateScheme,
|
||||
})
|
||||
f.MapStringFlag(&flagset.MapStringFlag{
|
||||
Name: "eth.requiredblocks",
|
||||
Usage: "Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)",
|
||||
|
|
|
|||
Loading…
Reference in a new issue