From 8de0a4cb242dd05c6ab363454314d5c7d09a4504 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 19 Oct 2017 19:45:29 -0700 Subject: [PATCH] peer: when logging message summaries use the correct preposition --- peer.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/peer.go b/peer.go index 720bdd5e..613e54bd 100644 --- a/peer.go +++ b/peer.go @@ -878,8 +878,13 @@ func (p *peer) logWireMessage(msg lnwire.Message, read bool) { summary = "(" + summary + ")" } - return fmt.Sprintf("%v %v%s from %s", summaryPrefix, - msg.MsgType(), summary, p) + preposition := "to" + if read { + preposition = "from" + } + + return fmt.Sprintf("%v %v%s %v %s", summaryPrefix, + msg.MsgType(), summary, preposition, p) })) switch m := msg.(type) {