htlcswitch: report failure source index for forwarding errors

This commit is contained in:
Joost Jager 2019-11-11 12:26:48 +01:00
parent 85dcaff0d9
commit 53076880f1
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -30,10 +30,14 @@ type ForwardingError struct {
// returned. // returned.
func (f *ForwardingError) Error() string { func (f *ForwardingError) Error() string {
if f.ExtraMsg == "" { 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 // ErrorDecrypter is an interface that is used to decrypt the onion encrypted