code: func (msg *MsgHeaders) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) error {
  	count, err := ReadVarInt(r, pver)
  	if err != nil {
  		return err
  	}
  
  	// Limit to max block headers per message.
  	if count > MaxBlockHeadersPerMsg {
  		str := fmt.Sprintf("too many block headers for message "+
  			"[count %v, max %v]", count, MaxBlockHeadersPerMsg)
  		return messageError("MsgHeaders.BtcDecode", str)
  	}
  
  	// Create a contiguous slice of headers to deserialize into in order to
  	// reduce the number of allocations.
  	headers := make([]BlockHeader, count)
  	msg.Headers = make([]*BlockHeader, 0, count)
  	for i := uint64(0); i < count; i++ {
  		bh := &headers[i]
  		err := readBlockHeader(r, pver, bh)
  		if err != nil {
  			return err
  		}
  
  		txCount, err := ReadVarInt(r, pver)
  		if err != nil {
  			return err
  		}
  
  		// Ensure the transaction count is zero for headers.
  		if txCount > 0 {
  			str := fmt.Sprintf("block headers may not contain "+
  				"transactions [count %v]", txCount)
  			return messageError("MsgHeaders.BtcDecode", str)
  		}
  		msg.AddBlockHeader(bh)
  	}
  
  	return nil
  }
docs: // BtcDecode decodes r using the bitcoin protocol encoding into the receiver.
  // This is part of the Message interface implementation.