// Decodes populates the target HopData with the contents of a serialized
// HopData packed into the passed io.Reader.
Decodes populates the target HopData with the contents of a serialized
HopData packed into the passed io.Reader.
// Decodes populates the target HopData with the contents of a serialized // HopData packed into the passed io . Reader .
func (hd *HopData) Decode(r io.Reader) error {
	if _, err := io.ReadFull(r, hd.Realm[:]); err != nil {
		return err
	}
	if _, err := io.ReadFull(r, hd.NextAddress[:]); err != nil {
		return err
	}
	err := binary.Read(r, binary.BigEndian, &hd.ForwardAmount)
	if err != nil {
		return err
	}
	err = binary.Read(r, binary.BigEndian, &hd.OutgoingCltv)
	if err != nil {
		return err
	}
	_, err = io.ReadFull(r, hd.ExtraBytes[:])
	return err
}
func ( hd * HopData ) Decode ( r io . Reader ) error { if _ , err := io . ReadFull ( r , hd . Realm [ : ] ) ; err != nil { return err } if _ , err := io . ReadFull ( r , hd . NextAddress [ : ] ) ; err != nil { return err } err := binary . Read ( r , binary . BigEndian , & hd . ForwardAmount ) if err != nil { return err } err = binary . Read ( r , binary . BigEndian , & hd . OutgoingCltv ) if err != nil { return err } _ , err = io . ReadFull ( r , hd . ExtraBytes [ : ] ) return err }
Decodes populates the target HopData with the contents of a serialized
HopData packed into the passed io.Reader.
Decodes populates the target HopData with the contents of a serialized HopData packed into the passed io . Reader .