channeldb: move idempotency up the call tree

As a preparation for subscribing to single invoices, InvoiceRegistry
needs to become aware of settling a settled invoice.
This commit is contained in:
Joost Jager committed 2019-02-01 09:42:56 +01:00
1 parent 2a4c93cdc4
commit 436dd41c77
3 files changed
+20 -16

No files matched your search

+3 -3
View File
@@ -359,10 +359,10 @@ func TestDuplicateSettleInvoice(t *testing.T) {
}
// If we try to settle the invoice again, then we should get the very
// same invoice back.
// same invoice back, but with an error this time.
dbInvoice, err = db.SettleInvoice(payHash, amt)
if err != nil {
t.Fatalf("unable to settle invoice: %v", err)
if err != ErrInvoiceAlreadySettled {
t.Fatalf("expected ErrInvoiceAlreadySettled")
}
if dbInvoice == nil {