mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +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
|
conf := *c
|
||||||
|
|
||||||
if conf.CommitThreshold == 0 {
|
if conf.CommitThreshold == 0 {
|
||||||
|
log.Warn("Sanitizing commit threshold", "provided", conf.CommitThreshold, "updated", defaultCommitThreshold)
|
||||||
conf.CommitThreshold = defaultCommitThreshold
|
conf.CommitThreshold = defaultCommitThreshold
|
||||||
}
|
}
|
||||||
return conf
|
return conf
|
||||||
|
|
@ -209,14 +210,12 @@ type Tree struct {
|
||||||
func New(config Config, diskdb ethdb.KeyValueStore, triedb *triedb.Database, root common.Hash) (*Tree, error) {
|
func New(config Config, diskdb ethdb.KeyValueStore, triedb *triedb.Database, root common.Hash) (*Tree, error) {
|
||||||
// Create a new, empty snapshot tree
|
// Create a new, empty snapshot tree
|
||||||
snap := &Tree{
|
snap := &Tree{
|
||||||
config: config,
|
config: config.sanitize(),
|
||||||
diskdb: diskdb,
|
diskdb: diskdb,
|
||||||
triedb: triedb,
|
triedb: triedb,
|
||||||
layers: make(map[common.Hash]snapshot),
|
layers: make(map[common.Hash]snapshot),
|
||||||
}
|
}
|
||||||
|
|
||||||
config = config.sanitize()
|
|
||||||
|
|
||||||
// Attempt to load a previously persisted snapshot and rebuild one if failed
|
// 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)
|
head, disabled, err := loadSnapshot(diskdb, triedb, root, config.CacheSize, config.Recovery, config.NoBuild)
|
||||||
if disabled {
|
if disabled {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue