mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
add sanitize logging
This commit is contained in:
parent
1dcf9e5515
commit
dae311f84f
1 changed files with 2 additions and 3 deletions
|
|
@ -164,6 +164,7 @@ func (c *Config) sanitize() Config {
|
|||
conf := *c
|
||||
|
||||
if conf.CommitThreshold == 0 {
|
||||
log.Warn("Sanitizing commit threshold", "provided", conf.CommitThreshold, "updated", defaultCommitThreshold)
|
||||
conf.CommitThreshold = defaultCommitThreshold
|
||||
}
|
||||
return conf
|
||||
|
|
@ -209,14 +210,12 @@ type Tree struct {
|
|||
func New(config Config, diskdb ethdb.KeyValueStore, triedb *triedb.Database, root common.Hash) (*Tree, error) {
|
||||
// Create a new, empty snapshot tree
|
||||
snap := &Tree{
|
||||
config: config,
|
||||
config: config.sanitize(),
|
||||
diskdb: diskdb,
|
||||
triedb: triedb,
|
||||
layers: make(map[common.Hash]snapshot),
|
||||
}
|
||||
|
||||
config = config.sanitize()
|
||||
|
||||
// Attempt to load a previously persisted snapshot and rebuild one if failed
|
||||
head, disabled, err := loadSnapshot(diskdb, triedb, root, config.CacheSize, config.Recovery, config.NoBuild)
|
||||
if disabled {
|
||||
|
|
|
|||
Loading…
Reference in a new issue