code: func (f *FilterHeaderStore) WriteHeaders(hdrs ...FilterHeader) error {
  	// Lock store for write.
  	f.mtx.Lock()
  	defer f.mtx.Unlock()
  
  	// If there are 0 headers to be written, return immediately. This
  	// prevents the newTip assignment from panicking because of an index
  	// of -1.
  	if len(hdrs) == 0 {
  		return nil
  	}
  
  	// First, we'll grab a buffer from the write buffer pool so we an
  	// reduce our total number of allocations, and also write the headers
  	// in a single swoop.
  	headerBuf := headerBufPool.Get().(*bytes.Buffer)
  	headerBuf.Reset()
  	defer headerBufPool.Put(headerBuf)
  
  	// Next, we'll write out all the passed headers in series into the
  	// buffer we just extracted from the pool.
  	for _, header := range hdrs {
  		if _, err := headerBuf.Write(header.FilterHash[:]); err != nil {
  			return err
  		}
  	}
  
  	// With all the headers written to the buffer, we'll now write out the
  	// entire batch in a single write call.
  	if err := f.appendRaw(headerBuf.Bytes()); err != nil {
  		return err
  	}
  
  	// As the block headers should already be written, we only need to
  	// update the tip pointer for this particular header type.
  	newTip := hdrs[len(hdrs)-1].toIndexEntry().hash
  	return f.truncateIndex(&newTip, false)
  }
docs: // WriteHeaders writes a batch of filter headers to persistent storage. The
  // headers themselves are appended to the flat file, and then the index updated
  // to reflect the new entires.