From 7e54b4ae4678d23b78d49f2dda77b31ea18de6ad Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 26 Dec 2017 16:17:13 +0100 Subject: [PATCH] lnwire: if unable to parse encapsulated error, log length and raw bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this commit, we add additional detail in the error return hen were’e unable to properly decode an encapsulated error. This additional logging was added with the goal of being able to track down a lingering bug, where at times lnd cannot decode a TemporaryChannelFailure message. --- lnwire/onion_error.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lnwire/onion_error.go b/lnwire/onion_error.go index 0d52b1cd..23330a93 100644 --- a/lnwire/onion_error.go +++ b/lnwire/onion_error.go @@ -532,6 +532,7 @@ func (f *FailTemporaryChannelFailure) Decode(r io.Reader, pver uint32) error { f.Update = &ChannelUpdate{} return f.Update.Decode(r, pver) } + return nil } @@ -1031,7 +1032,8 @@ func DecodeFailure(r io.Reader, pver uint32) (FailureMessage, error) { case Serializable: if err := f.Decode(dataReader, pver); err != nil { return nil, fmt.Errorf("unable to decode error "+ - "update (%T): %v", err, failure) + "update (type=%T, len_bytes=%v, bytes=%x): %v", + failure, failureLength, failureData[:], err) } }