From f7800709ba1aaa3f0781d1a5aa1b8e6df9d40935 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 28 Jul 2017 16:32:12 -0700 Subject: [PATCH] lnwire: use %v instead of %x when printing length of oversized msg --- brontide/noise.go | 3 +++ lnwire/message.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/brontide/noise.go b/brontide/noise.go index ea86d0bc..2ab935bf 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -567,6 +567,9 @@ func (b *Machine) RecvActThree(actThree [ActThreeSize]byte) error { "valid", actThree[0], HandshakeVersion) } + // TODO(roasbeef): print out entire version each time, also print out + // which act the error occurred at + copy(s[:], actThree[1:33+16+1]) copy(p[:], actThree[33+16+1:]) diff --git a/lnwire/message.go b/lnwire/message.go index 00a7c428..d646aba7 100644 --- a/lnwire/message.go +++ b/lnwire/message.go @@ -214,7 +214,7 @@ func WriteMessage(w io.Writer, msg Message, pver uint32) (int, error) { if uint32(lenp) > mpl { return totalBytes, fmt.Errorf("message payload is too large - "+ "encoded %d bytes, but maximum message payload of "+ - "type %x is %d bytes", lenp, msg.MsgType(), mpl) + "type %v is %d bytes", lenp, msg.MsgType(), mpl) } // With the initial sanity checks complete, we'll now write out the