channeldb+invoices: use payment addr as primary index

This commit is contained in:
Conner Fromknecht committed 2020-05-26 18:55:27 -07:00
1 parent 3522f09a08
commit cbf71b5452
7 files changed
+286 -34

No files matched your search

+4
View File
@@ -25,6 +25,10 @@ type invoiceUpdateCtx struct {
// invoiceRef returns an identifier that can be used to lookup or update the
// invoice this HTLC is targeting.
func (i *invoiceUpdateCtx) invoiceRef() channeldb.InvoiceRef {
if i.mpp != nil {
payAddr := i.mpp.PaymentAddr()
return channeldb.InvoiceRefByHashAndAddr(i.hash, payAddr)
}
return channeldb.InvoiceRefByHash(i.hash)
}