Skip to content

Commit

Permalink
support returning incorrect details in interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt authored and yaslama committed Apr 19, 2023
1 parent a1aeaab commit 3bd3c78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htlcswitch/interceptable_switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ func (f *interceptedForward) FailWithCode(code lnwire.FailCode) error {
OnionSHA256: shaOnionBlob(),
}

case lnwire.CodeIncorrectOrUnknownPaymentDetails:
failureMsg = &lnwire.FailIncorrectDetails{}

case lnwire.CodeTemporaryChannelFailure:
update := f.htlcSwitch.failAliasUpdate(
f.packet.incomingChanID, true,
Expand Down
3 changes: 3 additions & 0 deletions lnrpc/routerrpc/forward_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ func (r *forwardInterceptor) resolveFromClient(
case lnrpc.Failure_INVALID_ONION_VERSION:
code = lnwire.CodeInvalidOnionVersion

case lnrpc.Failure_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS:
code = lnwire.CodeIncorrectOrUnknownPaymentDetails

// Default to TemporaryChannelFailure.
case 0, lnrpc.Failure_TEMPORARY_CHANNEL_FAILURE:
code = lnwire.CodeTemporaryChannelFailure
Expand Down

0 comments on commit 3bd3c78

Please sign in to comment.