Skip to content

Commit 599eb2e

Browse files
committed
challenger: skip trying to load+parse AMP invoices
AMP invoiecs don't have a payment hash, as it's based on payment addr and set id.
1 parent 510d409 commit 599eb2e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

challenger/lnd.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ func (l *LndChallenger) Start() error {
102102
// updates for new invoices and/or newly settled invoices.
103103
l.invoicesMtx.Lock()
104104
for _, invoice := range invoiceResp.Invoices {
105+
// Some invoices like AMP invoices may not have a payment hash
106+
// populated.
107+
if invoice.RHash == nil {
108+
continue
109+
}
110+
105111
if invoice.AddIndex > addIndex {
106112
addIndex = invoice.AddIndex
107113
}
@@ -207,6 +213,12 @@ func (l *LndChallenger) readInvoiceStream(
207213
default:
208214
}
209215

216+
// Some invoices like AMP invoices may not have a payment hash
217+
// populated.
218+
if invoice.RHash == nil {
219+
continue
220+
}
221+
210222
hash, err := lntypes.MakeHash(invoice.RHash)
211223
if err != nil {
212224
log.Errorf("Error parsing invoice hash: %v", err)

0 commit comments

Comments
 (0)