mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 19:44:27 +02:00
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:
@@ -48,9 +48,11 @@ func (p *Ping) Decode(r io.Reader, pver uint32) error {
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (p *Ping) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
return WriteElements(w,
|
||||
p.NumPongBytes,
|
||||
p.PaddingBytes)
|
||||
if err := WriteUint16(w, p.NumPongBytes); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return WritePingPayload(w, p.PaddingBytes)
|
||||
}
|
||||
|
||||
// MsgType returns the integer uniquely identifying this message type on the
|
||||
|
Reference in New Issue
Block a user