mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
wire/msgping: remove usage for read/writeElement
This commit is contained in:
parent
7207967135
commit
3698f2deab
@ -32,10 +32,11 @@ func (msg *MsgPing) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) err
|
||||
// NOTE: > is not a mistake here. The BIP0031 was defined as AFTER
|
||||
// the version unlike most others.
|
||||
if pver > BIP0031Version {
|
||||
err := readElement(r, &msg.Nonce)
|
||||
nonce, err := binarySerializer.Uint64(r, littleEndian)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
msg.Nonce = nonce
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -48,7 +49,7 @@ func (msg *MsgPing) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) err
|
||||
// NOTE: > is not a mistake here. The BIP0031 was defined as AFTER
|
||||
// the version unlike most others.
|
||||
if pver > BIP0031Version {
|
||||
err := writeElement(w, msg.Nonce)
|
||||
err := binarySerializer.PutUint64(w, littleEndian, msg.Nonce)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user