htlcswitch: add failure details to incoming failures

This commit adds LinkErrors with failure details to htlcs which fail on
our incoming link. This change is made with the intention of notifying
detailed htlc failure reasons in sendHTLCError. The FailureDetail
interface is implemented on FailureResolutionResults so that they can
directly be used to enrich LinkErrors. sendHtlcError is updated to
take a LinkError in preparation for the addition of a htlcnotifier
which will notify the detail of the error.
This commit is contained in:
carla
2020-02-06 19:35:17 +02:00
parent 74e0d545fe
commit 1ad395ec3f
2 changed files with 27 additions and 13 deletions

View File

@@ -107,8 +107,10 @@ const (
ResultMppInProgress
)
// String returns a string representation of the result.
func (f FailResolutionResult) String() string {
// FailureString returns a string representation of the result.
//
// Note: it is part of the FailureDetail interface.
func (f FailResolutionResult) FailureString() string {
switch f {
case resultInvalidFailure:
return "invalid failure result"