// update the key pair of self
update the key pair of self
// update the key pair of self
func (c *GroupChannel) Update(privKey []byte) error {
	ng, err := c.state.Copy()
	if err != nil {
		return err
	}
	if err := ng.UpdateSelf(privKey); err != nil {
		return err
	}
	path := ng.GetSelfPath()
	pkt, err := c.protocol.marshal(c.state, &packet.Update{path})
	if err != nil {
		return err
	}
	if err := c.protocol.ds.Send(pkt); err != nil {
		return err
	}
	return nil
}
func ( c * GroupChannel ) Update ( privKey [ ] byte ) error { ng , err := c . state . Copy ( ) if err != nil { return err } if err := ng . UpdateSelf ( privKey ) ; err != nil { return err } path := ng . GetSelfPath ( ) pkt , err := c . protocol . marshal ( c . state , & packet . Update { path } ) if err != nil { return err } if err := c . protocol . ds . Send ( pkt ) ; err != nil { return err } return nil }
update the key pair of self
update the key pair of self