code: func (s *Sync) Commit(dbw ethdb.Writer) (int, error) {
  	// Dump the membatch into a database dbw
  	for i, key := range s.membatch.order {
  		if err := dbw.Put(key[:], s.membatch.batch[key]); err != nil {
  			return i, err
  		}
  	}
  	written := len(s.membatch.order)
  
  	// Drop the membatch data and return
  	s.membatch = newSyncMemBatch()
  	return written, nil
  }
docs: // Commit flushes the data stored in the internal membatch out to persistent
  // storage, returning the number of items written and any occurred error.