• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.74
/invoices/resolution_result.go
1
package invoices
2

3
// acceptResolutionResult provides metadata which about a htlc that was
4
// accepted by the registry.
5
type acceptResolutionResult uint8
6

7
const (
8
        resultInvalidAccept acceptResolutionResult = iota
9

10
        // resultReplayToAccepted is returned when we replay an accepted
11
        // invoice.
12
        resultReplayToAccepted
13

14
        // resultDuplicateToAccepted is returned when we accept a duplicate
15
        // htlc.
16
        resultDuplicateToAccepted
17

18
        // resultAccepted is returned when we accept a hodl invoice.
19
        resultAccepted
20

21
        // resultPartialAccepted is returned when we have partially received
22
        // payment.
23
        resultPartialAccepted
24
)
25

26
// String returns a string representation of the result.
27
func (a acceptResolutionResult) String() string {
3✔
28
        switch a {
3✔
29
        case resultInvalidAccept:
×
30
                return "invalid accept result"
×
31

32
        case resultReplayToAccepted:
3✔
33
                return "replayed htlc to accepted invoice"
3✔
34

35
        case resultDuplicateToAccepted:
×
36
                return "accepting duplicate payment to accepted invoice"
×
37

38
        case resultAccepted:
3✔
39
                return "accepted"
3✔
40

41
        case resultPartialAccepted:
3✔
42
                return "partial payment accepted"
3✔
43

44
        default:
×
45
                return "unknown accept resolution result"
×
46
        }
47
}
48

49
// FailResolutionResult provides metadata about a htlc that was failed by
50
// the registry. It can be used to take custom actions on resolution of the
51
// htlc.
52
type FailResolutionResult uint8
53

54
const (
55
        resultInvalidFailure FailResolutionResult = iota
56

57
        // ResultReplayToCanceled is returned when we replay a canceled invoice.
58
        ResultReplayToCanceled
59

60
        // ResultInvoiceAlreadyCanceled is returned when trying to pay an
61
        // invoice that is already canceled.
62
        ResultInvoiceAlreadyCanceled
63

64
        // ResultInvoiceAlreadySettled is returned when trying to pay an invoice
65
        // that is already settled.
66
        ResultInvoiceAlreadySettled
67

68
        // ResultAmountTooLow is returned when an invoice is underpaid.
69
        ResultAmountTooLow
70

71
        // ResultExpiryTooSoon is returned when we do not accept an invoice
72
        // payment because it expires too soon.
73
        ResultExpiryTooSoon
74

75
        // ResultCanceled is returned when we cancel an invoice and its
76
        // associated htlcs.
77
        ResultCanceled
78

79
        // ResultInvoiceNotOpen is returned when a mpp invoice is not open.
80
        ResultInvoiceNotOpen
81

82
        // ResultMppTimeout is returned when an invoice paid with multiple
83
        // partial payments times out before it is fully paid.
84
        ResultMppTimeout
85

86
        // ResultAddressMismatch is returned when the payment address for a mpp
87
        // invoice does not match.
88
        ResultAddressMismatch
89

90
        // ResultHtlcSetTotalMismatch is returned when the amount paid by a
91
        // htlc does not match its set total.
92
        ResultHtlcSetTotalMismatch
93

94
        // ResultHtlcSetTotalTooLow is returned when a mpp set total is too low
95
        // for an invoice.
96
        ResultHtlcSetTotalTooLow
97

98
        // ResultHtlcSetOverpayment is returned when a mpp set is overpaid.
99
        ResultHtlcSetOverpayment
100

101
        // ResultInvoiceNotFound is returned when an attempt is made to pay an
102
        // invoice that is unknown to us.
103
        ResultInvoiceNotFound
104

105
        // ResultKeySendError is returned when we receive invalid keysend
106
        // parameters.
107
        ResultKeySendError
108

109
        // ResultMppInProgress is returned when we are busy receiving a mpp
110
        // payment.
111
        ResultMppInProgress
112

113
        // ResultHtlcInvoiceTypeMismatch is returned when an AMP HTLC targets a
114
        // non-AMP invoice and vice versa.
115
        ResultHtlcInvoiceTypeMismatch
116

117
        // ResultAmpError is returned when we receive invalid AMP parameters.
118
        ResultAmpError
119

120
        // ResultAmpReconstruction is returned when the derived child
121
        // hash/preimage pairs were invalid for at least one HTLC in the set.
122
        ResultAmpReconstruction
123
)
124

125
// String returns a string representation of the result.
126
func (f FailResolutionResult) String() string {
3✔
127
        return f.FailureString()
3✔
128
}
3✔
129

130
// FailureString returns a string representation of the result.
131
//
132
// Note: it is part of the FailureDetail interface.
133
func (f FailResolutionResult) FailureString() string {
3✔
134
        switch f {
3✔
135
        case resultInvalidFailure:
×
136
                return "invalid failure result"
×
137

138
        case ResultReplayToCanceled:
3✔
139
                return "replayed htlc to canceled invoice"
3✔
140

141
        case ResultInvoiceAlreadyCanceled:
×
142
                return "invoice already canceled"
×
143

144
        case ResultInvoiceAlreadySettled:
×
145
                return "invoice already settled"
×
146

147
        case ResultAmountTooLow:
3✔
148
                return "amount too low"
3✔
149

150
        case ResultExpiryTooSoon:
×
151
                return "expiry too soon"
×
152

153
        case ResultCanceled:
3✔
154
                return "canceled"
3✔
155

156
        case ResultInvoiceNotOpen:
×
157
                return "invoice no longer open"
×
158

159
        case ResultMppTimeout:
×
160
                return "mpp timeout"
×
161

162
        case ResultAddressMismatch:
×
163
                return "payment address mismatch"
×
164

165
        case ResultHtlcSetTotalMismatch:
×
166
                return "htlc total amt doesn't match set total"
×
167

168
        case ResultHtlcSetTotalTooLow:
×
169
                return "set total too low for invoice"
×
170

171
        case ResultHtlcSetOverpayment:
×
172
                return "mpp is overpaying set total"
×
173

174
        case ResultInvoiceNotFound:
3✔
175
                return "invoice not found"
3✔
176

177
        case ResultKeySendError:
×
178
                return "invalid keysend parameters"
×
179

180
        case ResultMppInProgress:
×
181
                return "mpp reception in progress"
×
182

183
        case ResultHtlcInvoiceTypeMismatch:
×
184
                return "htlc invoice type mismatch"
×
185

186
        case ResultAmpError:
×
187
                return "invalid amp parameters"
×
188

189
        case ResultAmpReconstruction:
×
190
                return "amp reconstruction failed"
×
191

192
        default:
×
193
                return "unknown failure resolution result"
×
194
        }
195
}
196

197
// IsSetFailure returns true if this failure should result in the entire HTLC
198
// set being failed with the same result.
199
func (f FailResolutionResult) IsSetFailure() bool {
3✔
200
        switch f {
3✔
201
        case
202
                ResultAmpReconstruction,
203
                ResultHtlcSetTotalTooLow,
204
                ResultHtlcSetTotalMismatch,
205
                ResultHtlcSetOverpayment:
×
206

×
207
                return true
×
208

209
        default:
3✔
210
                return false
3✔
211
        }
212
}
213

214
// SettleResolutionResult provides metadata which about a htlc that was failed
215
// by the registry. It can be used to take custom actions on resolution of the
216
// htlc.
217
type SettleResolutionResult uint8
218

219
const (
220
        resultInvalidSettle SettleResolutionResult = iota
221

222
        // ResultSettled is returned when we settle an invoice.
223
        ResultSettled
224

225
        // ResultReplayToSettled is returned when we replay a settled invoice.
226
        ResultReplayToSettled
227

228
        // ResultDuplicateToSettled is returned when we settle an invoice which
229
        // has already been settled at least once.
230
        ResultDuplicateToSettled
231
)
232

233
// String returns a string representation of the result.
234
func (s SettleResolutionResult) String() string {
3✔
235
        switch s {
3✔
236
        case resultInvalidSettle:
×
237
                return "invalid settle result"
×
238

239
        case ResultSettled:
3✔
240
                return "settled"
3✔
241

242
        case ResultReplayToSettled:
3✔
243
                return "replayed htlc to settled invoice"
3✔
244

245
        case ResultDuplicateToSettled:
×
246
                return "accepting duplicate payment to settled invoice"
×
247

248
        default:
×
249
                return "unknown settle resolution result"
×
250
        }
251
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc