peer: when logging message summaries use the correct preposition

This commit is contained in:
Olaoluwa Osuntokun 2017-10-19 19:45:29 -07:00
parent 4cf4fd377f
commit 8de0a4cb24
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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) {