mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-24 11:58:11 +00:00
core/rawdb: fix key length check for num -- hash in db inspect (#34074)
Fix incorrect key length calculation for `numHashPairings` in `InspectDatabase`, introduced in #34000. The `headerHashKey` format is `headerPrefix + num + headerHashSuffix` (10 bytes), but the check incorrectly included `common.HashLength`, expecting 42 bytes. This caused all number -- hash entries to be misclassified as unaccounted data.
This commit is contained in:
parent
305cd7b9eb
commit
e23b0cbc22
1 changed files with 1 additions and 1 deletions
|
|
@ -480,7 +480,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
|
|||
receipts.add(size)
|
||||
case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerTDSuffix) && len(key) == (len(headerPrefix)+8+common.HashLength+len(headerTDSuffix)):
|
||||
tds.add(size)
|
||||
case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerHashSuffix) && len(key) == (len(headerPrefix)+8+common.HashLength+len(headerHashSuffix)):
|
||||
case bytes.HasPrefix(key, headerPrefix) && bytes.HasSuffix(key, headerHashSuffix) && len(key) == (len(headerPrefix)+8+len(headerHashSuffix)):
|
||||
numHashPairings.add(size)
|
||||
case bytes.HasPrefix(key, headerNumberPrefix) && len(key) == (len(headerNumberPrefix)+common.HashLength):
|
||||
hashNumPairings.add(size)
|
||||
|
|
|
|||
Loading…
Reference in a new issue