lnwire: refactor Encode to use specific writers - II
This commit takes another 10 message types and refactors their Encode method to use specific writers. The following commit will refactor the rest.
This commit is contained in:
10 files changed
+213
-87
No files matched your search
+9
-1
@@ -48,7 +48,15 @@ func (s *Shutdown) Decode(r io.Reader, pver uint32) error {
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (s *Shutdown) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
return WriteElements(w, s.ChannelID, s.Address, s.ExtraData)
|
||||
if err := WriteChannelID(w, s.ChannelID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := WriteDeliveryAddress(w, s.Address); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return WriteBytes(w, s.ExtraData)
|
||||
}
|
||||
|
||||
// MsgType returns the integer uniquely identifying this message type on the
|
||||
|
||||
Reference in new issue
Block a user