mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 02:02:10 +02:00
multi: extend InvoiceDB
methods with a context argument (#8066)
* multi: extend InvoiceDB methods with a context argument This commit adds a context to InvoiceDB's methods. Along this refactor we also extend InvoiceRegistry methods with contexts where it makes sense. This change is essential to be able to provide kvdb and sqldb implementations for InvoiceDB. * channeldb: restrict invoice tests to only use an InvoiceDB instance * docs: update release notes for 0.18.0
This commit is contained in:
committed by
GitHub
parent
9478b85e59
commit
ad5cd9c8bb
@@ -2,6 +2,7 @@ package contractcourt
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -1885,7 +1886,7 @@ func (c *ChannelArbitrator) isPreimageAvailable(hash lntypes.Hash) (bool,
|
||||
// than the invoice cltv delta. We don't want to go to chain only to
|
||||
// have the incoming contest resolver decide that we don't want to
|
||||
// settle this invoice.
|
||||
invoice, err := c.cfg.Registry.LookupInvoice(hash)
|
||||
invoice, err := c.cfg.Registry.LookupInvoice(context.Background(), hash)
|
||||
switch err {
|
||||
case nil:
|
||||
case invoices.ErrInvoiceNotFound, invoices.ErrNoInvoicesCreated:
|
||||
|
Reference in New Issue
Block a user