From cbb28edb30f361f6e56213b8b4adae1142c2c56a Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 10 May 2013 21:31:56 -0500 Subject: [PATCH] Convert MsgPong errors to MessageError type. --- msgpong.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/msgpong.go b/msgpong.go index 8794ebd5..70127726 100644 --- a/msgpong.go +++ b/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 // the version unlike most others. if pver <= BIP0031Version { - err := fmt.Errorf("pong message invalid for protocol version: %d", - pver) - return err + str := fmt.Sprintf("pong message invalid for protocol "+ + "version %d", pver) + return messageError("MsgPong.BtcDecode", str) } 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 // the version unlike most others. if pver <= BIP0031Version { - err := fmt.Errorf("pong message invalid for protocol version: %d", - pver) - return err + str := fmt.Sprintf("pong message invalid for protocol "+ + "version %d", pver) + return messageError("MsgPong.BtcEncode", str) } err := writeElement(w, msg.Nonce)