lnrpc: add failure detail none to link event rpc
This commit is contained in:
parent
2c979fc179
commit
e229717025
@ -120,15 +120,21 @@ func rpcFailReason(linkErr *htlcswitch.LinkError) (lnrpc.Failure_FailureCode,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
|
wireCode := wireErr.GetCode()
|
||||||
|
|
||||||
|
// If the link has no failure detail, return with failure detail none.
|
||||||
|
if linkErr.FailureDetail == nil {
|
||||||
|
return wireCode, FailureDetail_NO_DETAIL, nil
|
||||||
|
}
|
||||||
|
|
||||||
switch failureDetail := linkErr.FailureDetail.(type) {
|
switch failureDetail := linkErr.FailureDetail.(type) {
|
||||||
case invoices.FailResolutionResult:
|
case invoices.FailResolutionResult:
|
||||||
fd, err := rpcFailureResolution(failureDetail)
|
fd, err := rpcFailureResolution(failureDetail)
|
||||||
return wireErr.GetCode(), fd, err
|
return wireCode, fd, err
|
||||||
|
|
||||||
case htlcswitch.OutgoingFailure:
|
case htlcswitch.OutgoingFailure:
|
||||||
fd, err := rpcOutgoingFailure(failureDetail)
|
fd, err := rpcOutgoingFailure(failureDetail)
|
||||||
return wireErr.GetCode(), fd, err
|
return wireCode, fd, err
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0, 0, fmt.Errorf("unknown failure "+
|
return 0, 0, fmt.Errorf("unknown failure "+
|
||||||
|
Loading…
Reference in New Issue
Block a user