mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
core/rawdb: improve condition
This commit is contained in:
parent
7ca68af0c4
commit
2103b17608
1 changed files with 10 additions and 10 deletions
|
|
@ -492,17 +492,17 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
|
||||||
default:
|
default:
|
||||||
unaccounted.Add(size)
|
unaccounted.Add(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Metadata keys
|
||||||
|
case slices.ContainsFunc(knownMetadataKeys, func(x []byte) bool { return bytes.Equal(x, key) }):
|
||||||
|
metadata.Add(size)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if slices.ContainsFunc(knownMetadataKeys, func(x []byte) bool { return bytes.Equal(x, key) }) {
|
unaccounted.Add(size)
|
||||||
metadata.Add(size)
|
if len(key) >= 2 {
|
||||||
} else {
|
prefix := [2]byte(key[:2])
|
||||||
unaccounted.Add(size)
|
if _, ok := unaccountedKeys[prefix]; !ok {
|
||||||
// track unaccounted key examples:
|
unaccountedKeys[prefix] = bytes.Clone(key)
|
||||||
if len(key) >= 2 {
|
|
||||||
prefix := [2]byte(key[:2])
|
|
||||||
if _, ok := unaccountedKeys[prefix]; !ok {
|
|
||||||
unaccountedKeys[prefix] = bytes.Clone(key)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue