File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1049,6 +1049,8 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
1049
1049
return nil , nil , err
1050
1050
}
1051
1051
1052
+ var cancelSet bool
1053
+
1052
1054
// Provide the invoice to the settlement interceptor to allow
1053
1055
// the interceptor's client an opportunity to manipulate the
1054
1056
// settlement process.
@@ -1066,6 +1068,8 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
1066
1068
if resp .AmountPaid != 0 {
1067
1069
ctx .amtPaid = resp .AmountPaid
1068
1070
}
1071
+
1072
+ cancelSet = resp .CancelSet
1069
1073
})
1070
1074
if err != nil {
1071
1075
err := fmt .Errorf ("error during invoice HTLC interception: %w" ,
@@ -1092,7 +1096,18 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
1092
1096
updateDesc .State != nil
1093
1097
1094
1098
// Assign resolution to outer scope variable.
1095
- resolution = res
1099
+ if cancelSet {
1100
+ // If a cancel signal was set for the htlc set, we set
1101
+ // the resolution as a failure with an underpayment
1102
+ // indication. Something was wrong with this htlc, so
1103
+ // we probably can't settle the invoice at all.
1104
+ resolution = NewFailResolution (
1105
+ ctx .circuitKey , ctx .currentHeight ,
1106
+ ResultAmountTooLow ,
1107
+ )
1108
+ } else {
1109
+ resolution = res
1110
+ }
1096
1111
1097
1112
return updateDesc , nil
1098
1113
}
You can’t perform that action at this time.
0 commit comments