code: func (msg *MsgCFHeaders) BtcDecode(r io.Reader, pver uint32, _ MessageEncoding) error {
  	// Read filter type
  	err := readElement(r, &msg.FilterType)
  	if err != nil {
  		return err
  	}
  
  	// Read stop hash
  	err = readElement(r, &msg.StopHash)
  	if err != nil {
  		return err
  	}
  
  	// Read prev filter header
  	err = readElement(r, &msg.PrevFilterHeader)
  	if err != nil {
  		return err
  	}
  
  	// Read number of filter headers
  	count, err := ReadVarInt(r, pver)
  	if err != nil {
  		return err
  	}
  
  	// Limit to max committed filter headers per message.
  	if count > MaxCFHeadersPerMsg {
  		str := fmt.Sprintf("too many committed filter headers for "+
  			"message [count %v, max %v]", count,
  			MaxBlockHeadersPerMsg)
  		return messageError("MsgCFHeaders.BtcDecode", str)
  	}
  
  	// Create a contiguous slice of hashes to deserialize into in order to
  	// reduce the number of allocations.
  	msg.FilterHashes = make([]*chainhash.Hash, 0, count)
  	for i := uint64(0); i < count; i++ {
  		var cfh chainhash.Hash
  		err := readElement(r, &cfh)
  		if err != nil {
  			return err
  		}
  		msg.AddCFHash(&cfh)
  	}
  
  	return nil
  }
docs: // BtcDecode decodes r using the bitcoin protocol encoding into the receiver.
  // This is part of the Message interface implementation.