mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
generate config
This commit is contained in:
parent
10cb63fc84
commit
6b7e6e69b7
1 changed files with 6 additions and 0 deletions
|
|
@ -66,6 +66,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
||||||
OverrideVerkle *uint64 `toml:",omitempty"`
|
OverrideVerkle *uint64 `toml:",omitempty"`
|
||||||
TxSyncDefaultTimeout time.Duration `toml:",omitempty"`
|
TxSyncDefaultTimeout time.Duration `toml:",omitempty"`
|
||||||
TxSyncMaxTimeout time.Duration `toml:",omitempty"`
|
TxSyncMaxTimeout time.Duration `toml:",omitempty"`
|
||||||
|
RangeLimit uint64 `toml:",omitempty"`
|
||||||
}
|
}
|
||||||
var enc Config
|
var enc Config
|
||||||
enc.Genesis = c.Genesis
|
enc.Genesis = c.Genesis
|
||||||
|
|
@ -117,6 +118,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
||||||
enc.OverrideVerkle = c.OverrideVerkle
|
enc.OverrideVerkle = c.OverrideVerkle
|
||||||
enc.TxSyncDefaultTimeout = c.TxSyncDefaultTimeout
|
enc.TxSyncDefaultTimeout = c.TxSyncDefaultTimeout
|
||||||
enc.TxSyncMaxTimeout = c.TxSyncMaxTimeout
|
enc.TxSyncMaxTimeout = c.TxSyncMaxTimeout
|
||||||
|
enc.RangeLimit = c.RangeLimit
|
||||||
return &enc, nil
|
return &enc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,6 +174,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
||||||
OverrideVerkle *uint64 `toml:",omitempty"`
|
OverrideVerkle *uint64 `toml:",omitempty"`
|
||||||
TxSyncDefaultTimeout *time.Duration `toml:",omitempty"`
|
TxSyncDefaultTimeout *time.Duration `toml:",omitempty"`
|
||||||
TxSyncMaxTimeout *time.Duration `toml:",omitempty"`
|
TxSyncMaxTimeout *time.Duration `toml:",omitempty"`
|
||||||
|
RangeLimit *uint64 `toml:",omitempty"`
|
||||||
}
|
}
|
||||||
var dec Config
|
var dec Config
|
||||||
if err := unmarshal(&dec); err != nil {
|
if err := unmarshal(&dec); err != nil {
|
||||||
|
|
@ -324,5 +327,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
||||||
if dec.TxSyncMaxTimeout != nil {
|
if dec.TxSyncMaxTimeout != nil {
|
||||||
c.TxSyncMaxTimeout = *dec.TxSyncMaxTimeout
|
c.TxSyncMaxTimeout = *dec.TxSyncMaxTimeout
|
||||||
}
|
}
|
||||||
|
if dec.RangeLimit != nil {
|
||||||
|
c.RangeLimit = *dec.RangeLimit
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue