cmd, core, ethdb: fix function description

This commit is contained in:
Gary Rong 2024-06-19 11:11:20 +08:00
parent ea17320272
commit 4a21582d20
3 changed files with 6 additions and 5 deletions

View file

@ -408,11 +408,12 @@ func checkStateContent(ctx *cli.Context) error {
} }
func showDBStats(db ethdb.KeyValueStater) { 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) log.Warn("Failed to read database stats", "error", err)
} else { return
fmt.Println(stats)
} }
fmt.Println(stats)
} }
func dbStats(ctx *cli.Context) error { func dbStats(ctx *cli.Context) error {

View file

@ -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) { func (t *table) Stat() (string, error) {
return t.db.Stat() return t.db.Stat()
} }

View file

@ -182,7 +182,7 @@ func (db *Database) NewSnapshot() (ethdb.Snapshot, error) {
return newSnapshot(db), nil 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) { func (db *Database) Stat() (string, error) {
return "", nil return "", nil
} }