func (this *Version) WriteTo(w io.Writer) (int64, error) { var dw dataio.DataWriter dw.Init(w) err := dw.WriteInt32(this.Version) if err != nil { return dw.Count(), err } err = dw.WriteUint64(this.Services) if err != nil { return dw.Count(), err } err = dw.WriteTime64(this.Time) if err != nil { return dw.Count(), err } err = dw.WriteWriterTo(&this.Receive) if err != nil { return dw.Count(), err } err = dw.WriteWriterTo(&this.From) if err != nil { return dw.Count(), err } err = dw.WriteUint64(this.Nonce) if err != nil { return dw.Count(), err } err = dw.WriteVarString(this.UserAgent) if err != nil { return dw.Count(), err } err = dw.WriteInt32(this.StartHeight) if err != nil { return dw.Count(), err } return dw.Count(), nil }
func (this *VersionNetworkAddress) WriteTo(w io.Writer) (int64, error) { var dw dataio.DataWriter dw.Init(w) err := dw.WriteUint64(this.Services) if err != nil { return dw.Count(), err } err = dw.WriteTCPAddr(&this.Address) if err != nil { return dw.Count(), err } return dw.Count(), nil }