channeldb+invoices: use payment addr as primary index

This commit is contained in:
Conner Fromknecht
2020-05-21 15:37:39 -07:00
parent 3522f09a08
commit cbf71b5452
7 changed files with 286 additions and 34 deletions

View File

@@ -43,6 +43,14 @@ var (
// payment hash already exists.
ErrDuplicateInvoice = fmt.Errorf("invoice with payment hash already exists")
// ErrDuplicatePayAddr is returned when an invoice with the target
// payment addr already exists.
ErrDuplicatePayAddr = fmt.Errorf("invoice with payemnt addr already exists")
// ErrInvRefEquivocation is returned when an InvoiceRef targets
// multiple, distinct invoices.
ErrInvRefEquivocation = errors.New("inv ref matches multiple invoices")
// ErrNoPaymentsCreated is returned when bucket of payments hasn't been
// created.
ErrNoPaymentsCreated = fmt.Errorf("there are no existing payments")