From 53076880f1e137c6a40c3a105b2a81ed12621c1c Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Mon, 11 Nov 2019 12:26:48 +0100 Subject: [PATCH] htlcswitch: report failure source index for forwarding errors --- htlcswitch/failure.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htlcswitch/failure.go b/htlcswitch/failure.go index 4526e356..0d817a07 100644 --- a/htlcswitch/failure.go +++ b/htlcswitch/failure.go @@ -30,10 +30,14 @@ type ForwardingError struct { // returned. func (f *ForwardingError) Error() string { if f.ExtraMsg == "" { - return fmt.Sprintf("%v", f.FailureMessage) + return fmt.Sprintf( + "%v@%v", f.FailureMessage, f.FailureSourceIdx, + ) } - return fmt.Sprintf("%v: %v", f.FailureMessage, f.ExtraMsg) + return fmt.Sprintf( + "%v@%v: %v", f.FailureMessage, f.FailureSourceIdx, f.ExtraMsg, + ) } // ErrorDecrypter is an interface that is used to decrypt the onion encrypted