code: func (c *ChainIndexer) setValidSections(sections uint64) {
  	// Set the current number of valid sections in the database
  	var data [8]byte
  	binary.BigEndian.PutUint64(data[:], sections)
  	c.indexDb.Put([]byte("count"), data[:])
  
  	// Remove any reorged sections, caching the valids in the mean time
  	for c.storedSections > sections {
  		c.storedSections--
  		c.removeSectionHead(c.storedSections)
  	}
  	c.storedSections = sections // needed if new > old
  }
docs: // setValidSections writes the number of valid sections to the index database