mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
accept changes
This commit is contained in:
parent
030f628ca7
commit
15e5fd81c7
2 changed files with 7 additions and 9 deletions
|
|
@ -35,17 +35,10 @@ type freezerInfo struct {
|
||||||
ancients uint64 // The total number of stored items in the freezer
|
ancients uint64 // The total number of stored items in the freezer
|
||||||
head uint64 // The number of last stored item in the freezer, valid only if ancients > 0
|
head uint64 // The number of last stored item in the freezer, valid only if ancients > 0
|
||||||
tail uint64 // The number of first stored item in the freezer
|
tail uint64 // The number of first stored item in the freezer
|
||||||
|
count uint64 // The number of stored items in the freezer
|
||||||
sizes []tableSize // The storage size per table
|
sizes []tableSize // The storage size per table
|
||||||
}
|
}
|
||||||
|
|
||||||
// count returns the number of stored items in the freezer.
|
|
||||||
func (info *freezerInfo) count() uint64 {
|
|
||||||
if info.ancients <= info.tail {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return info.ancients - info.tail
|
|
||||||
}
|
|
||||||
|
|
||||||
// size returns the storage size of the entire freezer.
|
// size returns the storage size of the entire freezer.
|
||||||
func (info *freezerInfo) size() common.StorageSize {
|
func (info *freezerInfo) size() common.StorageSize {
|
||||||
var total common.StorageSize
|
var total common.StorageSize
|
||||||
|
|
@ -82,6 +75,11 @@ func inspect(name string, order map[string]freezerTableConfig, reader ethdb.Anci
|
||||||
return freezerInfo{}, err
|
return freezerInfo{}, err
|
||||||
}
|
}
|
||||||
info.tail = tail
|
info.tail = tail
|
||||||
|
if ancients == 0 {
|
||||||
|
info.count = 0
|
||||||
|
} else {
|
||||||
|
info.count = info.head - info.tail + 1
|
||||||
|
}
|
||||||
return info, nil
|
return info, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
|
||||||
fmt.Sprintf("Ancient store (%s)", strings.Title(ancient.name)),
|
fmt.Sprintf("Ancient store (%s)", strings.Title(ancient.name)),
|
||||||
strings.Title(table.name),
|
strings.Title(table.name),
|
||||||
table.size.String(),
|
table.size.String(),
|
||||||
fmt.Sprintf("%d", ancient.count()),
|
fmt.Sprintf("%d", ancient.count),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
total.Add(uint64(ancient.size()))
|
total.Add(uint64(ancient.size()))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue