Deserialize message payload
(source *comm.ZeroCopySource)
| 70 | |
| 71 | //Deserialize message payload |
| 72 | func (this *Version) Deserialization(source *comm.ZeroCopySource) error { |
| 73 | var irregular, eof bool |
| 74 | this.P.Version, eof = source.NextUint32() |
| 75 | this.P.Services, eof = source.NextUint64() |
| 76 | this.P.TimeStamp, eof = source.NextInt64() |
| 77 | this.P.SyncPort, eof = source.NextUint16() |
| 78 | this.P.HttpInfoPort, eof = source.NextUint16() |
| 79 | this.P.ConsPort, eof = source.NextUint16() |
| 80 | var buf []byte |
| 81 | buf, eof = source.NextBytes(uint64(len(this.P.Cap[:]))) |
| 82 | copy(this.P.Cap[:], buf) |
| 83 | |
| 84 | this.P.Nonce, eof = source.NextUint64() |
| 85 | this.P.StartHeight, eof = source.NextUint64() |
| 86 | this.P.Relay, eof = source.NextUint8() |
| 87 | this.P.IsConsensus, irregular, eof = source.NextBool() |
| 88 | if eof { |
| 89 | return io.ErrUnexpectedEOF |
| 90 | } |
| 91 | if irregular { |
| 92 | return comm.ErrIrregularData |
| 93 | } |
| 94 | |
| 95 | this.P.SoftVersion, _, irregular, eof = source.NextString() |
| 96 | if eof || irregular { |
| 97 | this.P.SoftVersion = "" |
| 98 | } |
| 99 | |
| 100 | return nil |
| 101 | } |
nothing calls this directly
no test coverage detected