diff --git a/triedb/pathdb/history_trienode.go b/triedb/pathdb/history_trienode.go index 1f63e6b438..a065d02eb8 100644 --- a/triedb/pathdb/history_trienode.go +++ b/triedb/pathdb/history_trienode.go @@ -396,12 +396,12 @@ func decodeRestartTrailer(keySection []byte) ([]uint32, []uint32, int, error) { return nil, nil, 0, fmt.Errorf("key section too short, size: %d", len(keySection)) } nRestarts := binary.BigEndian.Uint32(keySection[len(keySection)-4:]) + + // Decode the trailer var ( keyOffsets = make([]uint32, 0, int(nRestarts)) valOffsets = make([]uint32, 0, int(nRestarts)) ) - - // Decode the trailer if len(keySection) < int(8*nRestarts)+4 { return nil, nil, 0, fmt.Errorf("key section too short, restarts: %d, size: %d", nRestarts, len(keySection)) }