eth/ethconfig: fix config gen

This commit is contained in:
Gary Rong 2025-04-18 17:25:16 +08:00 committed by lightclient
parent 7711484969
commit 2e99333809
No known key found for this signature in database
GPG key ID: 657913021EF45A6A

View file

@ -37,6 +37,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
DatabaseHandles int `toml:"-"` DatabaseHandles int `toml:"-"`
DatabaseCache int DatabaseCache int
DatabaseFreezer string DatabaseFreezer string
DatabaseEra string
TrieCleanCache int TrieCleanCache int
TrieDirtyCache int TrieDirtyCache int
TrieTimeout time.Duration TrieTimeout time.Duration
@ -77,6 +78,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.DatabaseHandles = c.DatabaseHandles enc.DatabaseHandles = c.DatabaseHandles
enc.DatabaseCache = c.DatabaseCache enc.DatabaseCache = c.DatabaseCache
enc.DatabaseFreezer = c.DatabaseFreezer enc.DatabaseFreezer = c.DatabaseFreezer
enc.DatabaseEra = c.DatabaseEra
enc.TrieCleanCache = c.TrieCleanCache enc.TrieCleanCache = c.TrieCleanCache
enc.TrieDirtyCache = c.TrieDirtyCache enc.TrieDirtyCache = c.TrieDirtyCache
enc.TrieTimeout = c.TrieTimeout enc.TrieTimeout = c.TrieTimeout
@ -121,6 +123,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
DatabaseHandles *int `toml:"-"` DatabaseHandles *int `toml:"-"`
DatabaseCache *int DatabaseCache *int
DatabaseFreezer *string DatabaseFreezer *string
DatabaseEra *string
TrieCleanCache *int TrieCleanCache *int
TrieDirtyCache *int TrieDirtyCache *int
TrieTimeout *time.Duration TrieTimeout *time.Duration
@ -204,6 +207,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.DatabaseFreezer != nil { if dec.DatabaseFreezer != nil {
c.DatabaseFreezer = *dec.DatabaseFreezer c.DatabaseFreezer = *dec.DatabaseFreezer
} }
if dec.DatabaseEra != nil {
c.DatabaseEra = *dec.DatabaseEra
}
if dec.TrieCleanCache != nil { if dec.TrieCleanCache != nil {
c.TrieCleanCache = *dec.TrieCleanCache c.TrieCleanCache = *dec.TrieCleanCache
} }