Convert MsgPong errors to MessageError type.
This commit is contained in:
parent
1220e72f35
commit
cbb28edb30
1 changed files with 6 additions and 6 deletions
12
msgpong.go
12
msgpong.go
|
@ -26,9 +26,9 @@ func (msg *MsgPong) BtcDecode(r io.Reader, pver uint32) error {
|
||||||
// NOTE: <= is not a mistake here. The BIP0031 was defined as AFTER
|
// NOTE: <= is not a mistake here. The BIP0031 was defined as AFTER
|
||||||
// the version unlike most others.
|
// the version unlike most others.
|
||||||
if pver <= BIP0031Version {
|
if pver <= BIP0031Version {
|
||||||
err := fmt.Errorf("pong message invalid for protocol version: %d",
|
str := fmt.Sprintf("pong message invalid for protocol "+
|
||||||
pver)
|
"version %d", pver)
|
||||||
return err
|
return messageError("MsgPong.BtcDecode", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := readElement(r, &msg.Nonce)
|
err := readElement(r, &msg.Nonce)
|
||||||
|
@ -45,9 +45,9 @@ func (msg *MsgPong) BtcEncode(w io.Writer, pver uint32) error {
|
||||||
// NOTE: <= is not a mistake here. The BIP0031 was defined as AFTER
|
// NOTE: <= is not a mistake here. The BIP0031 was defined as AFTER
|
||||||
// the version unlike most others.
|
// the version unlike most others.
|
||||||
if pver <= BIP0031Version {
|
if pver <= BIP0031Version {
|
||||||
err := fmt.Errorf("pong message invalid for protocol version: %d",
|
str := fmt.Sprintf("pong message invalid for protocol "+
|
||||||
pver)
|
"version %d", pver)
|
||||||
return err
|
return messageError("MsgPong.BtcEncode", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := writeElement(w, msg.Nonce)
|
err := writeElement(w, msg.Nonce)
|
||||||
|
|
Loading…
Reference in a new issue