diff --git a/cmd/geth/dbcmd.go b/cmd/geth/dbcmd.go index f63aba07f1..4b683569a4 100644 --- a/cmd/geth/dbcmd.go +++ b/cmd/geth/dbcmd.go @@ -408,11 +408,12 @@ func checkStateContent(ctx *cli.Context) error { } func showDBStats(db ethdb.KeyValueStater) { - if stats, err := db.Stat(); err != nil { + stats, err := db.Stat() + if err != nil { log.Warn("Failed to read database stats", "error", err) - } else { - fmt.Println(stats) + return } + fmt.Println(stats) } func dbStats(ctx *cli.Context) error { diff --git a/core/rawdb/table.go b/core/rawdb/table.go index 4687ff07fe..90849fe9d9 100644 --- a/core/rawdb/table.go +++ b/core/rawdb/table.go @@ -147,7 +147,7 @@ func (t *table) NewIterator(prefix []byte, start []byte) ethdb.Iterator { } } -// Stat returns a particular internal stat of the database. +// Stat returns the statistic data of the database. func (t *table) Stat() (string, error) { return t.db.Stat() } diff --git a/ethdb/memorydb/memorydb.go b/ethdb/memorydb/memorydb.go index fa306c56d1..9b0872f89a 100644 --- a/ethdb/memorydb/memorydb.go +++ b/ethdb/memorydb/memorydb.go @@ -182,7 +182,7 @@ func (db *Database) NewSnapshot() (ethdb.Snapshot, error) { return newSnapshot(db), nil } -// Stat returns a particular internal stat of the database. +// Stat returns the statistic data of the database. func (db *Database) Stat() (string, error) { return "", nil }