diff --git a/message.go b/message.go index 13d0d77a..f1ee1f4f 100644 --- a/message.go +++ b/message.go @@ -160,8 +160,9 @@ func WriteMessage(w io.Writer, msg Message, pver uint32, btcnet BitcoinNet) erro cmd := msg.Command() if len(cmd) > commandSize { - str := "WriteMessage: command is too long [%s]" - return fmt.Errorf(str, command) + str := fmt.Sprintf("command [%s] is too long [max %v]", + cmd, commandSize) + return messageError("WriteMessage", str) } copy(command[:], []byte(cmd))