mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
wire/msgpong: remove usage of read/writeElement
This commit is contained in:
parent
3698f2deab
commit
80ae5d342c
@ -31,7 +31,13 @@ func (msg *MsgPong) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) err
|
||||
return messageError("MsgPong.BtcDecode", str)
|
||||
}
|
||||
|
||||
return readElement(r, &msg.Nonce)
|
||||
nonce, err := binarySerializer.Uint64(r, littleEndian)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
msg.Nonce = nonce
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// BtcEncode encodes the receiver to w using the bitcoin protocol encoding.
|
||||
@ -45,7 +51,7 @@ func (msg *MsgPong) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) err
|
||||
return messageError("MsgPong.BtcEncode", str)
|
||||
}
|
||||
|
||||
return writeElement(w, msg.Nonce)
|
||||
return binarySerializer.PutUint64(w, littleEndian, msg.Nonce)
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
|
Loading…
Reference in New Issue
Block a user