htlcswitch: report failure source index for forwarding errors

This commit is contained in:
Joost Jager committed 2019-11-12 14:13:29 +01:00
1 parent 85dcaff0d9
commit 53076880f1
1 file changed
+6 -2
+6 -2
View File
@@ -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