Repository: lightningnetwork/lnd
Pull request #8090 (2023-10-12 09:10:02)

Add more information when a co-op close is failing.
## Change Description
Resulting from discussions in the noderunner group where someone could not co-op close a channel but was not able to understand why:

Logs where only showing:

```
==> /var/log/syslog <==
Oct 10 13:21:09 lnd[1591]: 2023-10-10 13:21:09.933 [INF] PEER: Peer(xxx): Local close channel request delivered to peer
==> /home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log <==2023-10-10 13:21:09.950 [ERR] PEER: Peer(xxx): failed link shutdown: link failed to shutdown
```
This had the appearance that the peer somehow was not willing to cooperate ("request delivered to peer"), now we give the user better feedback what's happening.

Now would be:

```
2023-10-12 11:22:08.349 [INF] PEER: Peer(0355402a07589a522375f83b6f6c42c4144d219ec3810e0a2aefb8ae99bdabd095): Local close channel request is going to be delivered to the peer
2023-10-12 11:22:08.367 [INF] PEER: Peer(0355402a07589a522375f83b6f6c42c4144d219ec3810e0a2aefb8ae99bdabd095): Delivery addr for channel close: bcrt1p2szcuwgt3dzkf5awkw27xzjrshf6vdsrx0y5sqj67w6flueh0pwqelcxp2
2023-10-12 11:22:08.367 [INF] HSWC: ChannelLink(877b1cd70661da033ab740928b6d0ca9ee6dcf023859f8f38e1381d45b036efc:0): Channel is in an unclean state (lingering updates), graceful shutdown of channel link not possible
2023-10-12 11:22:08.367 [ERR] PEER: Peer(0355402a07589a522375f83b6f6c42c4144d219ec3810e0a2aefb8ae99bdabd095): failed link shutdown: link failed to shutdown
```
And for the receiver:
`[lncli] rpc error: code = Unknown desc = failed handling co-op closing request with (try force closing it instead): link failed to shutdown`



Patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 31a594c3a..9001f1771 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -213,7 +213,7 @@ jobs:
         run: ./scripts/install_bitcoind.sh
 
       - name: run ${{ matrix.unit_type }}
-        run: make log="stdlog debug" ${{ matrix.unit_type }}
+        run: make ${{ matrix.unit_type }}
 
       - name: Send coverage
         uses: shogo82148/actions-goveralls@v1
diff --git a/channeldb/db.go b/channeldb/db.go
index bf170e2ba..18a66c46e 100644
--- a/channeldb/db.go
+++ b/channeldb/db.go
@@ -28,7 +28,6 @@ import (
 	"github.com/lightningnetwork/lnd/channeldb/migration31"
 	"github.com/lightningnetwork/lnd/channeldb/migration_01_to_11"
 	"github.com/lightningnetwork/lnd/clock"
-	"github.com/lightningnetwork/lnd/invoices"
 	"github.com/lightningnetwork/lnd/kvdb"
 	"github.com/lightningnetwork/lnd/lnwire"
 	"github.com/lightningnetwork/lnd/routing/route"
@@ -1825,14 +1824,6 @@ func (c *ChannelStateDB) PutOnchainFinalHtlcOutcome(
 	}, func() {})
 }
 
-// MakeTestInvoiceDB is used to create a test invoice database for testing
-// purposes. It simply calls into MakeTestDB so the same modifiers can be used.
-func MakeTestInvoiceDB(t *testing.T, modifiers ...OptionModifier) (
-	invoices.InvoiceDB, error) {
-
-	return MakeTestDB(t, modifiers...)
-}
-
 // MakeTestDB creates a new instance of the ChannelDB for testing purposes.
 // A callback which cleans up the created temporary directories is also
 // returned and intended to be executed after the test completes.
diff --git a/channeldb/invoices.go b/channeldb/invoices.go
index d7016ff33..1567c4183 100644
--- a/channeldb/invoices.go
+++ b/channeldb/invoices.go
@@ -2,7 +2,6 @@ package channeldb
 
 import (
 	"bytes"
-	"context"
 	"encoding/binary"
 	"errors"
 	"fmt"
@@ -141,8 +140,8 @@ const (
 // insertion will be aborted and rejected due to the strict policy banning any
 // duplicate payment hashes. A side effect of this function is that it sets
 // AddIndex on newInvoice.
-func (d *DB) AddInvoice(_ context.Context, newInvoice *invpkg.Invoice,
-	paymentHash lntypes.Hash) (uint64, error) {
+func (d *DB) AddInvoice(newInvoice *invpkg.Invoice, paymentHash lntypes.Hash) (
+	uint64, error) {
 
 	if err := invpkg.ValidateInvoice(newInvoice, paymentHash); err != nil {
 		return 0, err
@@ -230,8 +229,8 @@ func (d *DB) AddInvoice(_ context.Context, newInvoice *invpkg.Invoice,
 //
 // NOTE: The index starts from 1, as a result. We enforce that specifying a
 // value below the starting index value is a noop.
-func (d *DB) InvoicesAddedSince(_ context.Context, sinceAddIndex uint64) (
-	[]invpkg.Invoice, error) {
+func (d *DB) InvoicesAddedSince(sinceAddIndex uint64) ([]invpkg.Invoice,
+	error) {
 
 	var newInvoices []invpkg.Invoice
 
@@ -294,9 +293,7 @@ func (d *DB) InvoicesAddedSince(_ context.Context, sinceAddIndex uint64) (
 // full invoice is returned. Before setting the incoming HTLC, the values
 // SHOULD be checked to ensure the payer meets the agreed upon contractual
 // terms of the payment.
-func (d *DB) LookupInvoice(_ context.Context, ref invpkg.InvoiceRef) (
-	invpkg.Invoice, error) {
-
+func (d *DB) LookupInvoice(ref invpkg.InvoiceRef) (invpkg.Invoice, error) {
 	var invoice invpkg.Invoice
 	err := kvdb.View(d, func(tx kvdb.RTx) error {
 		invoices := tx.ReadBucket(invoiceBucket)
@@ -437,9 +434,7 @@ func fetchInvoiceNumByRef(invoiceIndex, payAddrIndex, setIDIndex kvdb.RBucket,
 // for each invoice with its respective payment hash. Additionally a reset()
 // closure is passed which is used to reset/initialize partial results and also
 // to signal if the kvdb.View transaction has been retried.
-func (d *DB) ScanInvoices(_ context.Context, scanFunc invpkg.InvScanFunc,
-	reset func()) error {
-
+func (d *DB) ScanInvoices(scanFunc invpkg.InvScanFunc, reset func()) error {
 	return kvdb.View(d, func(tx kvdb.RTx) error {
 		invoices := tx.ReadBucket(invoiceBucket)
 		if invoices == nil {
@@ -482,8 +477,8 @@ func (d *DB) ScanInvoices(_ context.Context, scanFunc invpkg.InvScanFunc,
 
 // QueryInvoices allows a caller to query the invoice database for invoices
 // within the specified add index range.
-func (d *DB) QueryInvoices(_ context.Context, q invpkg.InvoiceQuery) (
-	invpkg.InvoiceSlice, error) {
+func (d *DB) QueryInvoices(q invpkg.InvoiceQuery) (invpkg.InvoiceSlice,
+	error) {
 
 	var (
 		resp         invpkg.InvoiceSlice
@@ -599,9 +594,8 @@ func (d *DB) QueryInvoices(_ context.Context, q invpkg.InvoiceQuery) (
 // The update is performed inside the same database transaction that fetches the
 // invoice and is therefore atomic. The fields to update are controlled by the
 // supplied callback.
-func (d *DB) UpdateInvoice(_ context.Context, ref invpkg.InvoiceRef,
-	setIDHint *invpkg.SetID, callback invpkg.InvoiceUpdateCallback) (
-	*invpkg.Invoice, error) {
+func (d *DB) UpdateInvoice(ref invpkg.InvoiceRef, setIDHint *invpkg.SetID,
+	callback invpkg.InvoiceUpdateCallback) (*invpkg.Invoice, error) {
 
 	var updatedInvoice *invpkg.Invoice
 	err := kvdb.Update(d, func(tx kvdb.RwTx) error {
@@ -654,8 +648,8 @@ func (d *DB) UpdateInvoice(_ context.Context, ref invpkg.InvoiceRef,
 //
 // NOTE: The index starts from 1, as a result. We enforce that specifying a
 // value below the starting index value is a noop.
-func (d *DB) InvoicesSettledSince(_ context.Context, sinceSettleIndex uint64) (
-	[]invpkg.Invoice, error) {
+func (d *DB) InvoicesSettledSince(sinceSettleIndex uint64) ([]invpkg.Invoice,
+	error) {
 
 	var settledInvoices []invpkg.Invoice
 
@@ -2705,9 +2699,7 @@ func delAMPSettleIndex(invoiceNum []byte, invoices,
 // DeleteInvoice attempts to delete the passed invoices from the database in
 // one transaction. The passed delete references hold all keys required to
 // delete the invoices without also needing to deserialze them.
-func (d *DB) DeleteInvoice(_ context.Context,
-	invoicesToDelete []invpkg.InvoiceDeleteRef) error {
-
+func (d *DB) DeleteInvoice(invoicesToDelete []invpkg.InvoiceDeleteRef) error {
 	err := kvdb.Update(d, func(tx kvdb.RwTx) error {
 		invoices := tx.ReadWriteBucket(invoiceBucket)
 		if invoices == nil {
diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go
index 8423fd2cc..e1cbb1173 100644
--- a/contractcourt/channel_arbitrator.go
+++ b/contractcourt/channel_arbitrator.go
@@ -2,7 +2,6 @@ package contractcourt
 
 import (
 	"bytes"
-	"context"
 	"errors"
 	"fmt"
 	"math"
@@ -1310,23 +1309,9 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions,
 			return err
 		}
 
-		// Create a force flag that's used to indicate whether we
-		// should force sweeping this anchor.
-		var force bool
-
-		// Check the deadline against the default value. If it's less
-		// than the default value of 144, it means there is a deadline
-		// and we will perform a CPFP for this commitment tx.
-		if deadline < anchorSweepConfTarget {
-			// Signal that this is a force sweep, so that the
-			// anchor will be swept even if it isn't economical
-			// purely based on the anchor value.
-			force = true
-		}
-
 		log.Debugf("ChannelArbitrator(%v): pre-confirmation sweep of "+
-			"anchor of %s commit tx %v, force=%v", c.cfg.ChanPoint,
-			anchorPath, anchor.CommitAnchor, force)
+			"anchor of %s commit tx %v", c.cfg.ChanPoint,
+			anchorPath, anchor.CommitAnchor)
 
 		witnessType := input.CommitmentAnchor
 
@@ -1352,17 +1337,20 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions,
 		)
 
 		// Sweep anchor output with a confirmation target fee
-		// preference. Because this is a cpfp-operation, the anchor
-		// will only be attempted to sweep when the current fee
-		// estimate for the confirmation target exceeds the commit fee
-		// rate.
+		// preference. Because this is a cpfp-operation, the anchor will
+		// only be attempted to sweep when the current fee estimate for
+		// the confirmation target exceeds the commit fee rate.
+		//
+		// Also signal that this is a force sweep, so that the anchor
+		// will be swept even if it isn't economical purely based on the
+		// anchor value.
 		_, err = c.cfg.Sweeper.SweepInput(
 			&anchorInput,
 			sweep.Params{
 				Fee: sweep.FeePreference{
 					ConfTarget: deadline,
 				},
-				Force:          force,
+				Force:          true,
 				ExclusiveGroup: &exclusiveGroup,
 			},
 		)
@@ -1439,9 +1427,6 @@ func (c *ChannelArbitrator) findCommitmentDeadline(heightHint uint32,
 
 		if htlc.RefundTimeout < deadlineMinHeight {
 			deadlineMinHeight = htlc.RefundTimeout
-			log.Tracef("ChannelArbitrator(%v): outgoing HTLC has "+
-				"deadline: %v", c.cfg.ChanPoint,
-				deadlineMinHeight)
 		}
 	}
 
@@ -1470,9 +1455,6 @@ func (c *ChannelArbitrator) findCommitmentDeadline(heightHint uint32,
 
 		if htlc.RefundTimeout < deadlineMinHeight {
 			deadlineMinHeight = htlc.RefundTimeout
-			log.Tracef("ChannelArbitrator(%v): incoming HTLC has "+
-				"deadline: %v", c.cfg.ChanPoint,
-				deadlineMinHeight)
 		}
 	}
 
@@ -1903,7 +1885,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(context.Background(), hash)
+	invoice, err := c.cfg.Registry.LookupInvoice(hash)
 	switch err {
 	case nil:
 	case invoices.ErrInvoiceNotFound, invoices.ErrNoInvoicesCreated:
diff --git a/contractcourt/interfaces.go b/contractcourt/interfaces.go
index 45cd75735..49e1f913a 100644
--- a/contractcourt/interfaces.go
+++ b/contractcourt/interfaces.go
@@ -1,7 +1,6 @@
 package contractcourt
 
 import (
-	"context"
 	"io"
 
 	"github.com/btcsuite/btcd/wire"
@@ -20,7 +19,7 @@ import (
 type Registry interface {
 	// LookupInvoice attempts to look up an invoice according to its 32
 	// byte payment hash.
-	LookupInvoice(context.Context, lntypes.Hash) (invoices.Invoice, error)
+	LookupInvoice(lntypes.Hash) (invoices.Invoice, error)
 
 	// NotifyExitHopHtlc attempts to mark an invoice as settled. If the
 	// invoice is a debug invoice, then this method is a noop as debug
diff --git a/docs/release-notes/release-notes-0.17.1.md b/docs/release-notes/release-notes-0.17.1.md
index 78260acbf..7af034b19 100644
--- a/docs/release-notes/release-notes-0.17.1.md
+++ b/docs/release-notes/release-notes-0.17.1.md
@@ -25,16 +25,6 @@
 
 # New Features
 ## Functional Enhancements
-
-- Previously, when a channel was force closed locally, its anchor was always
-  force-swept when the CPFP requirements are met. This is now
-  [changed](https://github.com/lightningnetwork/lnd/pull/7965) to only attempt
-  CPFP based on the deadline of the commitment transaction. The anchor output
-  will still be offered to the sweeper during channel force close, while the
-  actual sweeping won't be forced(CPFP) unless a relevant HTLC will timeout in
-  144 blocks. If CPFP before this deadline is needed, user can use `BumpFee`
-  instead.
-
 ## RPC Additions
 ## lncli Additions
 
@@ -54,5 +44,5 @@
 ## Tooling and Documentation
 
 # Contributors (Alphabetical Order)
-* Eugene Siegel
-* Yong Yu
+
+* Eugene Siegel
\ No newline at end of file
diff --git a/docs/release-notes/release-notes-0.18.0.md b/docs/release-notes/release-notes-0.18.0.md
index 2bf472de9..1f701cb6f 100644
--- a/docs/release-notes/release-notes-0.18.0.md
+++ b/docs/release-notes/release-notes-0.18.0.md
@@ -64,18 +64,11 @@
 ## BOLT Spec Updates
 ## Testing
 ## Database
-
-* [Add context to InvoiceDB
-  methods](https://github.com/lightningnetwork/lnd/pull/8066). This change adds
-  a context parameter to all `InvoiceDB` methods which is a pre-requisite for
-  the SQL implementation.
-
 ## Code Health
 ## Tooling and Documentation
 
 # Contributors (Alphabetical Order)
 
-* Andras Banki-Horvath
 * Carla Kirk-Cohen
 * Elle Mouton
 * Yong Yu
diff --git a/go.mod b/go.mod
index 5c7f172a3..a52191cf8 100644
--- a/go.mod
+++ b/go.mod
@@ -53,12 +53,12 @@ require (
 	github.com/urfave/cli v1.22.9
 	go.etcd.io/etcd/client/pkg/v3 v3.5.7
 	go.etcd.io/etcd/client/v3 v3.5.7
-	golang.org/x/crypto v0.14.0
+	golang.org/x/crypto v0.7.0
 	golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0
 	golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028
-	golang.org/x/net v0.17.0
+	golang.org/x/net v0.10.0
 	golang.org/x/sync v0.2.0
-	golang.org/x/term v0.13.0
+	golang.org/x/term v0.8.0
 	golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
 	google.golang.org/grpc v1.53.0
 	google.golang.org/protobuf v1.30.0
@@ -177,8 +177,8 @@ require (
 	go.uber.org/multierr v1.6.0 // indirect
 	go.uber.org/zap v1.17.0 // indirect
 	golang.org/x/mod v0.10.0 // indirect
-	golang.org/x/sys v0.13.0 // indirect
-	golang.org/x/text v0.13.0 // indirect
+	golang.org/x/sys v0.8.0 // indirect
+	golang.org/x/text v0.9.0 // indirect
 	golang.org/x/tools v0.9.1 // indirect
 	google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
 	gopkg.in/errgo.v1 v1.0.1 // indirect
diff --git a/go.sum b/go.sum
index 156dac4c6..cca09de17 100644
--- a/go.sum
+++ b/go.sum
@@ -702,8 +702,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y
 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
-golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
+golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
+golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -782,8 +782,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -870,14 +870,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
-golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
-golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
+golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -888,8 +888,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
diff --git a/healthcheck/go.mod b/healthcheck/go.mod
index 543c11d53..18c8b26d4 100644
--- a/healthcheck/go.mod
+++ b/healthcheck/go.mod
@@ -7,7 +7,7 @@ require (
 	github.com/lightningnetwork/lnd/ticker v1.1.0
 	github.com/lightningnetwork/lnd/tor v1.0.0
 	github.com/stretchr/testify v1.8.2
-	golang.org/x/sys v0.13.0
+	golang.org/x/sys v0.8.0
 )
 
 require (
@@ -17,7 +17,7 @@ require (
 	github.com/miekg/dns v1.1.43 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/rogpeppe/go-internal v1.9.0 // indirect
-	golang.org/x/net v0.17.0 // indirect
+	golang.org/x/net v0.10.0 // indirect
 	golang.org/x/sync v0.2.0 // indirect
 	gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/healthcheck/go.sum b/healthcheck/go.sum
index ebde8e6f8..a3cd43c45 100644
--- a/healthcheck/go.sum
+++ b/healthcheck/go.sum
@@ -88,8 +88,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
 golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
@@ -107,8 +107,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
diff --git a/htlcswitch/interfaces.go b/htlcswitch/interfaces.go
index 1ce4ffb2e..304f4a595 100644
--- a/htlcswitch/interfaces.go
+++ b/htlcswitch/interfaces.go
@@ -1,8 +1,6 @@
 package htlcswitch
 
 import (
-	"context"
-
 	"github.com/btcsuite/btcd/wire"
 	"github.com/lightningnetwork/lnd/channeldb"
 	"github.com/lightningnetwork/lnd/channeldb/models"
@@ -19,7 +17,7 @@ import (
 type InvoiceDatabase interface {
 	// LookupInvoice attempts to look up an invoice according to its 32
 	// byte payment hash.
-	LookupInvoice(context.Context, lntypes.Hash) (invoices.Invoice, error)
+	LookupInvoice(lntypes.Hash) (invoices.Invoice, error)
 
 	// NotifyExitHopHtlc attempts to mark an invoice as settled. If the
 	// invoice is a debug invoice, then this method is a noop as debug
@@ -35,10 +33,10 @@ type InvoiceDatabase interface {
 
 	// CancelInvoice attempts to cancel the invoice corresponding to the
 	// passed payment hash.
-	CancelInvoice(ctx context.Context, payHash lntypes.Hash) error
+	CancelInvoice(payHash lntypes.Hash) error
 
 	// SettleHodlInvoice settles a hold invoice.
-	SettleHodlInvoice(ctx context.Context, preimage lntypes.Preimage) error
+	SettleHodlInvoice(preimage lntypes.Preimage) error
 
 	// HodlUnsubscribeAll unsubscribes from all htlc resolutions.
 	HodlUnsubscribeAll(subscriber chan<- interface{})
diff --git a/htlcswitch/link.go b/htlcswitch/link.go
index 46aee939d..2a1e49923 100644
--- a/htlcswitch/link.go
+++ b/htlcswitch/link.go
@@ -1267,6 +1267,10 @@ func (l *channelLink) htlcManager() {
 				return
 			}
 
+			l.log.Infof("Channel is in an unclean state " +
+				"(lingering updates), graceful shutdown of " +
+				"channel link not possible")
+
 			// Otherwise, the channel has lingering updates, send
 			// an error and continue.
 			req.err <- ErrLinkFailedShutdown
diff --git a/htlcswitch/mock.go b/htlcswitch/mock.go
index 9b0453dea..fe593c9c5 100644
--- a/htlcswitch/mock.go
+++ b/htlcswitch/mock.go
@@ -2,7 +2,6 @@ package htlcswitch
 
 import (
 	"bytes"
-	"context"
 	"crypto/sha256"
 	"encoding/binary"
 	"fmt"
@@ -980,16 +979,16 @@ func newMockRegistry(minDelta uint32) *mockInvoiceRegistry {
 	}
 }
 
-func (i *mockInvoiceRegistry) LookupInvoice(ctx context.Context,
-	rHash lntypes.Hash) (invoices.Invoice, error) {
+func (i *mockInvoiceRegistry) LookupInvoice(rHash lntypes.Hash) (
+	invoices.Invoice, error) {
 
-	return i.registry.LookupInvoice(ctx, rHash)
+	return i.registry.LookupInvoice(rHash)
 }
 
 func (i *mockInvoiceRegistry) SettleHodlInvoice(
-	ctx context.Context, preimage lntypes.Preimage) error {
+	preimage lntypes.Preimage) error {
 
-	return i.registry.SettleHodlInvoice(ctx, preimage)
+	return i.registry.SettleHodlInvoice(preimage)
 }
 
 func (i *mockInvoiceRegistry) NotifyExitHopHtlc(rhash lntypes.Hash,
@@ -1011,16 +1010,14 @@ func (i *mockInvoiceRegistry) NotifyExitHopHtlc(rhash lntypes.Hash,
 	return event, nil
 }
 
-func (i *mockInvoiceRegistry) CancelInvoice(ctx context.Context,
-	payHash lntypes.Hash) error {
-
-	return i.registry.CancelInvoice(ctx, payHash)
+func (i *mockInvoiceRegistry) CancelInvoice(payHash lntypes.Hash) error {
+	return i.registry.CancelInvoice(payHash)
 }
 
-func (i *mockInvoiceRegistry) AddInvoice(ctx context.Context,
-	invoice invoices.Invoice, paymentHash lntypes.Hash) error {
+func (i *mockInvoiceRegistry) AddInvoice(invoice invoices.Invoice,
+	paymentHash lntypes.Hash) error {
 
-	_, err := i.registry.AddInvoice(ctx, &invoice, paymentHash)
+	_, err := i.registry.AddInvoice(&invoice, paymentHash)
 	return err
 }
 
diff --git a/invoices/interface.go b/invoices/interface.go
index 36bc0ea48..f717afd4e 100644
--- a/invoices/interface.go
+++ b/invoices/interface.go
@@ -1,7 +1,6 @@
 package invoices
 
 import (
-	"context"
 	"time"
 
 	"github.com/lightningnetwork/lnd/channeldb/models"
@@ -22,8 +21,7 @@ type InvoiceDB interface {
 	//
 	// NOTE: A side effect of this function is that it sets AddIndex on
 	// newInvoice.
-	AddInvoice(ctx context.Context, invoice *Invoice,
-		paymentHash lntypes.Hash) (uint64, error)
+	AddInvoice(invoice *Invoice, paymentHash lntypes.Hash) (uint64, error)
 
 	// InvoicesAddedSince can be used by callers to seek into the event
 	// time series of all the invoices added in the database. The specified
@@ -33,8 +31,7 @@ type InvoiceDB interface {
 	//
 	// NOTE: The index starts from 1, as a result. We enforce that
 	// specifying a value below the starting index value is a noop.
-	InvoicesAddedSince(ctx context.Context, sinceAddIndex uint64) (
-		[]Invoice, error)
+	InvoicesAddedSince(sinceAddIndex uint64) ([]Invoice, error)
 
 	// LookupInvoice attempts to look up an invoice according to its 32 byte
 	// payment hash. If an invoice which can settle the HTLC identified by
@@ -43,7 +40,7 @@ type InvoiceDB interface {
 	// Before setting the incoming HTLC, the values SHOULD be checked to
 	// ensure the payer meets the agreed upon contractual terms of the
 	// payment.
-	LookupInvoice(ctx context.Context, ref InvoiceRef) (Invoice, error)
+	LookupInvoice(ref InvoiceRef) (Invoice, error)
 
 	// ScanInvoices scans through all invoices and calls the passed scanFunc
 	// for each invoice with its respective payment hash. Additionally a
@@ -53,12 +50,11 @@ type InvoiceDB interface {
 	//
 	// TODO(positiveblue): abstract this functionality so it makes sense for
 	// other backends like sql.
-	ScanInvoices(ctx context.Context, scanFunc InvScanFunc,
-		reset func()) error
+	ScanInvoices(scanFunc InvScanFunc, reset func()) error
 
 	// QueryInvoices allows a caller to query the invoice database for
 	// invoices within the specified add index range.
-	QueryInvoices(ctx context.Context, q InvoiceQuery) (InvoiceSlice, error)
+	QueryInvoices(q InvoiceQuery) (InvoiceSlice, error)
 
 	// UpdateInvoice attempts to update an invoice corresponding to the
 	// passed payment hash. If an invoice matching the passed payment hash
@@ -71,7 +67,7 @@ type InvoiceDB interface {
 	//
 	// TODO(positiveblue): abstract this functionality so it makes sense for
 	// other backends like sql.
-	UpdateInvoice(ctx context.Context, ref InvoiceRef, setIDHint *SetID,
+	UpdateInvoice(ref InvoiceRef, setIDHint *SetID,
 		callback InvoiceUpdateCallback) (*Invoice, error)
 
 	// InvoicesSettledSince can be used by callers to catch up any settled
@@ -81,15 +77,13 @@ type InvoiceDB interface {
 	//
 	// NOTE: The index starts from 1, as a result. We enforce that
 	// specifying a value below the starting index value is a noop.
-	InvoicesSettledSince(ctx context.Context, sinceSettleIndex uint64) (
-		[]Invoice, error)
+	InvoicesSettledSince(sinceSettleIndex uint64) ([]Invoice, error)
 
 	// DeleteInvoice attempts to delete the passed invoices from the
 	// database in one transaction. The passed delete references hold all
 	// keys required to delete the invoices without also needing to
 	// deserialze them.
-	DeleteInvoice(ctx context.Context,
-		invoicesToDelete []InvoiceDeleteRef) error
+	DeleteInvoice(invoicesToDelete []InvoiceDeleteRef) error
 }
 
 // Payload abstracts access to any additional fields provided in the final hop's
diff --git a/invoices/invoiceregistry.go b/invoices/invoiceregistry.go
index e58ad4cdb..a9a5e3831 100644
--- a/invoices/invoiceregistry.go
+++ b/invoices/invoiceregistry.go
@@ -1,7 +1,6 @@
 package invoices
 
 import (
-	"context"
 	"errors"
 	"fmt"
 	"sync"
@@ -180,7 +179,7 @@ func NewRegistry(idb InvoiceDB, expiryWatcher *InvoiceExpiryWatcher,
 // scanInvoicesOnStart will scan all invoices on start and add active invoices
 // to the invoice expiry watcher while also attempting to delete all canceled
 // invoices.
-func (i *InvoiceRegistry) scanInvoicesOnStart(ctx context.Context) error {
+func (i *InvoiceRegistry) scanInvoicesOnStart() error {
 	var (
 		pending   []invoiceExpiry
 		removable []InvoiceDeleteRef
@@ -226,7 +225,7 @@ func (i *InvoiceRegistry) scanInvoicesOnStart(ctx context.Context) error {
 		return nil
 	}
 
-	err := i.idb.ScanInvoices(ctx, scanFunc, reset)
+	err := i.idb.ScanInvoices(scanFunc, reset)
 	if err != nil {
 		return err
 	}
@@ -238,7 +237,7 @@ func (i *InvoiceRegistry) scanInvoicesOnStart(ctx context.Context) error {
 	if len(removable) > 0 {
 		log.Infof("Attempting to delete %v canceled invoices",
 			len(removable))
-		if err := i.idb.DeleteInvoice(ctx, removable); err != nil {
+		if err := i.idb.DeleteInvoice(removable); err != nil {
 			log.Warnf("Deleting canceled invoices failed: %v", err)
 		} else {
 			log.Infof("Deleted %v canceled invoices",
@@ -253,9 +252,7 @@ func (i *InvoiceRegistry) scanInvoicesOnStart(ctx context.Context) error {
 func (i *InvoiceRegistry) Start() error {
 	// Start InvoiceExpiryWatcher and prepopulate it with existing active
 	// invoices.
-	err := i.expiryWatcher.Start(func(hash lntypes.Hash, force bool) error {
-		return i.cancelInvoiceImpl(context.Background(), hash, force)
-	})
+	err := i.expiryWatcher.Start(i.cancelInvoiceImpl)
 	if err != nil {
 		return err
 	}
@@ -267,7 +264,7 @@ func (i *InvoiceRegistry) Start() error {
 
 	// Now scan all pending and removable invoices to the expiry watcher or
 	// delete them.
-	err = i.scanInvoicesOnStart(context.Background())
+	err = i.scanInvoicesOnStart()
 	if err != nil {
 		_ = i.Stop()
 		return err
@@ -487,15 +484,15 @@ func (i *InvoiceRegistry) dispatchToClients(event *invoiceEvent) {
 
 // deliverBacklogEvents will attempts to query the invoice database for any
 // notifications that the client has missed since it reconnected last.
-func (i *InvoiceRegistry) deliverBacklogEvents(ctx context.Context,
+func (i *InvoiceRegistry) deliverBacklogEvents(
 	client *InvoiceSubscription) error {
 
-	addEvents, err := i.idb.InvoicesAddedSince(ctx, client.addIndex)
+	addEvents, err := i.idb.InvoicesAddedSince(client.addIndex)
 	if err != nil {
 		return err
 	}
 
-	settleEvents, err := i.idb.InvoicesSettledSince(ctx, client.settleIndex)
+	settleEvents, err := i.idb.InvoicesSettledSince(client.settleIndex)
 	if err != nil {
 		return err
 	}
@@ -539,10 +536,10 @@ func (i *InvoiceRegistry) deliverBacklogEvents(ctx context.Context,
 // invoice subscribers will always receive the current state right after
 // subscribing. Only in case the invoice does not yet exist, nothing is sent
 // yet.
-func (i *InvoiceRegistry) deliverSingleBacklogEvents(ctx context.Context,
+func (i *InvoiceRegistry) deliverSingleBacklogEvents(
 	client *SingleInvoiceSubscription) error {
 
-	invoice, err := i.idb.LookupInvoice(ctx, client.invoiceRef)
+	invoice, err := i.idb.LookupInvoice(client.invoiceRef)
 
 	// It is possible that the invoice does not exist yet, but the client is
 	// already watching it in anticipation.
@@ -582,7 +579,7 @@ func (i *InvoiceRegistry) deliverSingleBacklogEvents(ctx context.Context,
 // addIndex of the newly created invoice which monotonically increases for each
 // new invoice added.  A side effect of this function is that it also sets
 // AddIndex on the invoice argument.
-func (i *InvoiceRegistry) AddInvoice(ctx context.Context, invoice *Invoice,
+func (i *InvoiceRegistry) AddInvoice(invoice *Invoice,
 	paymentHash lntypes.Hash) (uint64, error) {
 
 	i.Lock()
@@ -590,7 +587,7 @@ func (i *InvoiceRegistry) AddInvoice(ctx context.Context, invoice *Invoice,
 	ref := InvoiceRefByHash(paymentHash)
 	log.Debugf("Invoice%v: added with terms %v", ref, invoice.Terms)
 
-	addIndex, err := i.idb.AddInvoice(ctx, invoice, paymentHash)
+	addIndex, err := i.idb.AddInvoice(invoice, paymentHash)
 	if err != nil {
 		i.Unlock()
 		return 0, err
@@ -616,21 +613,17 @@ func (i *InvoiceRegistry) AddInvoice(ctx context.Context, invoice *Invoice,
 // then we're able to pull the funds pending within an HTLC.
 //
 // TODO(roasbeef): ignore if settled?
-func (i *InvoiceRegistry) LookupInvoice(ctx context.Context,
-	rHash lntypes.Hash) (Invoice, error) {
-
+func (i *InvoiceRegistry) LookupInvoice(rHash lntypes.Hash) (Invoice, error) {
 	// We'll check the database to see if there's an existing matching
 	// invoice.
 	ref := InvoiceRefByHash(rHash)
-	return i.idb.LookupInvoice(ctx, ref)
+	return i.idb.LookupInvoice(ref)
 }
 
 // LookupInvoiceByRef looks up an invoice by the given reference, if found
 // then we're able to pull the funds pending within an HTLC.
-func (i *InvoiceRegistry) LookupInvoiceByRef(ctx context.Context,
-	ref InvoiceRef) (Invoice, error) {
-
-	return i.idb.LookupInvoice(ctx, ref)
+func (i *InvoiceRegistry) LookupInvoiceByRef(ref InvoiceRef) (Invoice, error) {
+	return i.idb.LookupInvoice(ref)
 }
 
 // startHtlcTimer starts a new timer via the invoice registry main loop that
@@ -730,8 +723,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef InvoiceRef,
 	// no invoice update is performed, we can return early.
 	setID := (*SetID)(invoiceRef.SetID())
 	var updated bool
-	invoice, err := i.idb.UpdateInvoice(
-		context.Background(), invoiceRef, setID,
+	invoice, err := i.idb.UpdateInvoice(invoiceRef, setID,
 		func(invoice *Invoice) (
 			*InvoiceUpdateDesc, error) {
 
@@ -838,7 +830,7 @@ func (i *InvoiceRegistry) processKeySend(ctx invoiceUpdateCtx) error {
 
 	// Insert invoice into database. Ignore duplicates, because this
 	// may be a replay.
-	_, err = i.AddInvoice(context.Background(), invoice, ctx.hash)
+	_, err = i.AddInvoice(invoice, ctx.hash)
 	if err != nil && !errors.Is(err, ErrDuplicateInvoice) {
 		return err
 	}
@@ -896,7 +888,7 @@ func (i *InvoiceRegistry) processAMP(ctx invoiceUpdateCtx) error {
 	// Insert invoice into database. Ignore duplicates payment hashes and
 	// payment addrs, this may be a replay or a different HTLC for the AMP
 	// invoice.
-	_, err := i.AddInvoice(context.Background(), invoice, ctx.hash)
+	_, err := i.AddInvoice(invoice, ctx.hash)
 	isDuplicatedInvoice := errors.Is(err, ErrDuplicateInvoice)
 	isDuplicatedPayAddr := errors.Is(err, ErrDuplicatePayAddr)
 	switch {
@@ -1053,9 +1045,7 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
 
 	invoiceRef := ctx.invoiceRef()
 	setID := (*SetID)(ctx.setID())
-	invoice, err := i.idb.UpdateInvoice(
-		context.Background(), invoiceRef, setID, callback,
-	)
+	invoice, err := i.idb.UpdateInvoice(invoiceRef, setID, callback)
 
 	var duplicateSetIDErr ErrDuplicateSetID
 	if errors.As(err, &duplicateSetIDErr) {
@@ -1238,9 +1228,7 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
 }
 
 // SettleHodlInvoice sets the preimage of a hodl invoice.
-func (i *InvoiceRegistry) SettleHodlInvoice(ctx context.Context,
-	preimage lntypes.Preimage) error {
-
+func (i *InvoiceRegistry) SettleHodlInvoice(preimage lntypes.Preimage) error {
 	i.Lock()
 	defer i.Unlock()
 
@@ -1267,7 +1255,7 @@ func (i *InvoiceRegistry) SettleHodlInvoice(ctx context.Context,
 
 	hash := preimage.Hash()
 	invoiceRef := InvoiceRefByHash(hash)
-	invoice, err := i.idb.UpdateInvoice(ctx, invoiceRef, nil, updateInvoice)
+	invoice, err := i.idb.UpdateInvoice(invoiceRef, nil, updateInvoice)
 	if err != nil {
 		log.Errorf("SettleHodlInvoice with preimage %v: %v",
 			preimage, err)
@@ -1302,10 +1290,8 @@ func (i *InvoiceRegistry) SettleHodlInvoice(ctx context.Context,
 
 // CancelInvoice attempts to cancel the invoice corresponding to the passed
 // payment hash.
-func (i *InvoiceRegistry) CancelInvoice(ctx context.Context,
-	payHash lntypes.Hash) error {
-
-	return i.cancelInvoiceImpl(ctx, payHash, true)
+func (i *InvoiceRegistry) CancelInvoice(payHash lntypes.Hash) error {
+	return i.cancelInvoiceImpl(payHash, true)
 }
 
 // shouldCancel examines the state of an invoice and whether we want to
@@ -1326,8 +1312,8 @@ func shouldCancel(state ContractState, cancelAccepted bool) bool {
 // payment hash. Accepted invoices will only be canceled if explicitly
 // requested to do so. It notifies subscribing links and resolvers that
 // the associated htlcs were canceled if they change state.
-func (i *InvoiceRegistry) cancelInvoiceImpl(ctx context.Context,
-	payHash lntypes.Hash, cancelAccepted bool) error {
+func (i *InvoiceRegistry) cancelInvoiceImpl(payHash lntypes.Hash,
+	cancelAccepted bool) error {
 
 	i.Lock()
 	defer i.Unlock()
@@ -1352,7 +1338,7 @@ func (i *InvoiceRegistry) cancelInvoiceImpl(ctx context.Context,
 	}
 
 	invoiceRef := InvoiceRefByHash(payHash)
-	invoice, err := i.idb.UpdateInvoice(ctx, invoiceRef, nil, updateInvoice)
+	invoice, err := i.idb.UpdateInvoice(invoiceRef, nil, updateInvoice)
 
 	// Implement idempotency by returning success if the invoice was already
 	// canceled.
@@ -1405,7 +1391,7 @@ func (i *InvoiceRegistry) cancelInvoiceImpl(ctx context.Context,
 			deleteRef.PayAddr = &invoice.Terms.PaymentAddr
 		}
 
-		err = i.idb.DeleteInvoice(ctx, []InvoiceDeleteRef{deleteRef})
+		err = i.idb.DeleteInvoice([]InvoiceDeleteRef{deleteRef})
 		// If by any chance deletion failed, then log it instead of
 		// returning the error, as the invoice itself has already been
 		// canceled.
@@ -1536,7 +1522,7 @@ func (i *invoiceSubscriptionKit) notify(event *invoiceEvent) error {
 // added. The invoiceIndex parameter is a streaming "checkpoint". We'll start
 // by first sending out all new events with an invoice index _greater_ than
 // this value. Afterwards, we'll send out real-time notifications.
-func (i *InvoiceRegistry) SubscribeNotifications(ctx context.Context,
+func (i *InvoiceRegistry) SubscribeNotifications(
 	addIndex, settleIndex uint64) (*InvoiceSubscription, error) {
 
 	client := &InvoiceSubscription{
@@ -1626,7 +1612,7 @@ func (i *InvoiceRegistry) SubscribeNotifications(ctx context.Context,
 
 	// Query the database to see if based on the provided addIndex and
 	// settledIndex we need to deliver any backlog notifications.
-	err := i.deliverBacklogEvents(ctx, client)
+	err := i.deliverBacklogEvents(client)
 	if err != nil {
 		return nil, err
 	}
@@ -1638,7 +1624,7 @@ func (i *InvoiceRegistry) SubscribeNotifications(ctx context.Context,
 
 // SubscribeSingleInvoice returns an SingleInvoiceSubscription which allows the
 // caller to receive async notifications for a specific invoice.
-func (i *InvoiceRegistry) SubscribeSingleInvoice(ctx context.Context,
+func (i *InvoiceRegistry) SubscribeSingleInvoice(
 	hash lntypes.Hash) (*SingleInvoiceSubscription, error) {
 
 	client := &SingleInvoiceSubscription{
@@ -1700,7 +1686,7 @@ func (i *InvoiceRegistry) SubscribeSingleInvoice(ctx context.Context,
 	i.singleNotificationClients[client.id] = client
 	i.notificationClientMux.Unlock()
 
-	err := i.deliverSingleBacklogEvents(ctx, client)
+	err := i.deliverSingleBacklogEvents(client)
 	if err != nil {
 		return nil, err
 	}
diff --git a/lnrpc/invoicesrpc/addinvoice.go b/lnrpc/invoicesrpc/addinvoice.go
index f300e4380..7c59da883 100644
--- a/lnrpc/invoicesrpc/addinvoice.go
+++ b/lnrpc/invoicesrpc/addinvoice.go
@@ -47,8 +47,8 @@ const (
 // AddInvoiceConfig contains dependencies for invoice creation.
 type AddInvoiceConfig struct {
 	// AddInvoice is called to add the invoice to the registry.
-	AddInvoice func(ctx context.Context, invoice *invoices.Invoice,
-		paymentHash lntypes.Hash) (uint64, error)
+	AddInvoice func(invoice *invoices.Invoice, paymentHash lntypes.Hash) (
+		uint64, error)
 
 	// IsChannelActive is used to generate valid hop hints.
 	IsChannelActive func(chanID lnwire.ChannelID) bool
@@ -478,7 +478,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
 	)
 
 	// With all sanity checks passed, write the invoice to the database.
-	_, err = cfg.AddInvoice(ctx, newInvoice, paymentHash)
+	_, err = cfg.AddInvoice(newInvoice, paymentHash)
 	if err != nil {
 		return nil, nil, err
 	}
diff --git a/lnrpc/invoicesrpc/invoices_server.go b/lnrpc/invoicesrpc/invoices_server.go
index b62538543..0c9ddf042 100644
--- a/lnrpc/invoicesrpc/invoices_server.go
+++ b/lnrpc/invoicesrpc/invoices_server.go
@@ -238,9 +238,7 @@ func (s *Server) SubscribeSingleInvoice(req *SubscribeSingleInvoiceRequest,
 		return err
 	}
 
-	invoiceClient, err := s.cfg.InvoiceRegistry.SubscribeSingleInvoice(
-		updateStream.Context(), hash,
-	)
+	invoiceClient, err := s.cfg.InvoiceRegistry.SubscribeSingleInvoice(hash)
 	if err != nil {
 		return err
 	}
@@ -289,7 +287,7 @@ func (s *Server) SettleInvoice(ctx context.Context,
 		return nil, err
 	}
 
-	err = s.cfg.InvoiceRegistry.SettleHodlInvoice(ctx, preimage)
+	err = s.cfg.InvoiceRegistry.SettleHodlInvoice(preimage)
 	if err != nil && !errors.Is(err, invoices.ErrInvoiceAlreadySettled) {
 		return nil, err
 	}
@@ -308,7 +306,7 @@ func (s *Server) CancelInvoice(ctx context.Context,
 		return nil, err
 	}
 
-	err = s.cfg.InvoiceRegistry.CancelInvoice(ctx, paymentHash)
+	err = s.cfg.InvoiceRegistry.CancelInvoice(paymentHash)
 	if err != nil {
 		return nil, err
 	}
@@ -435,9 +433,7 @@ func (s *Server) LookupInvoiceV2(ctx context.Context,
 
 	// Attempt to locate the invoice, returning a nice "not found" error if
 	// we can't find it in the database.
-	invoice, err := s.cfg.InvoiceRegistry.LookupInvoiceByRef(
-		ctx, invoiceRef,
-	)
+	invoice, err := s.cfg.InvoiceRegistry.LookupInvoiceByRef(invoiceRef)
 	switch {
 	case errors.Is(err, invoices.ErrInvoiceNotFound):
 		return nil, status.Error(codes.NotFound, err.Error())
diff --git a/peer/brontide.go b/peer/brontide.go
index 041776ea9..12ea39cf3 100644
--- a/peer/brontide.go
+++ b/peer/brontide.go
@@ -2982,7 +2982,10 @@ func (p *Brontide) handleLocalCloseReq(req *htlcswitch.ChanClose) {
 		// failed.
 		if err := p.tryLinkShutdown(chanID); err != nil {
 			p.log.Errorf("failed link shutdown: %v", err)
-			req.Err <- err
+
+			req.Err <- fmt.Errorf("failed handling co-op closing "+
+				"request with (try force closing "+
+				"it instead): %w", err)
 			return
 		}
 
@@ -3683,8 +3686,8 @@ func (p *Brontide) handleCloseMsg(msg *closeMsg) {
 func (p *Brontide) HandleLocalCloseChanReqs(req *htlcswitch.ChanClose) {
 	select {
 	case p.localCloseChanReqs <- req:
-		p.log.Info("Local close channel request delivered to " +
-			"peer")
+		p.log.Info("Local close channel request is going to be " +
+			"delivered to the peer")
 	case <-p.quit:
 		p.log.Info("Unable to deliver local close channel request " +
 			"to peer")
diff --git a/rpcserver.go b/rpcserver.go
index d8f99c91d..02bbde2b3 100644
--- a/rpcserver.go
+++ b/rpcserver.go
@@ -5663,7 +5663,7 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
 
 	rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:])
 
-	invoice, err := r.server.invoices.LookupInvoice(ctx, payHash)
+	invoice, err := r.server.invoices.LookupInvoice(payHash)
 	switch {
 	case errors.Is(err, invoices.ErrInvoiceNotFound):
 		return nil, status.Error(codes.NotFound, err.Error())
@@ -5726,7 +5726,7 @@ func (r *rpcServer) ListInvoices(ctx context.Context,
 		q.CreationDateEnd = time.Unix(int64(req.CreationDateEnd), 0)
 	}
 
-	invoiceSlice, err := r.server.miscDB.QueryInvoices(ctx, q)
+	invoiceSlice, err := r.server.miscDB.QueryInvoices(q)
 	if err != nil {
 		return nil, fmt.Errorf("unable to query invoices: %v", err)
 	}
@@ -5757,7 +5757,7 @@ func (r *rpcServer) SubscribeInvoices(req *lnrpc.InvoiceSubscription,
 	updateStream lnrpc.Lightning_SubscribeInvoicesServer) error {
 
 	invoiceClient, err := r.server.invoices.SubscribeNotifications(
-		updateStream.Context(), req.AddIndex, req.SettleIndex,
+		req.AddIndex, req.SettleIndex,
 	)
 	if err != nil {
 		return err
diff --git a/sweep/sweeper.go b/sweep/sweeper.go
index 46bb1f5bb..c11895198 100644
--- a/sweep/sweeper.go
+++ b/sweep/sweeper.go
@@ -1229,12 +1229,6 @@ func (s *UtxoSweeper) getInputLists(cluster inputCluster,
 	// contain inputs that failed before. Therefore we also add sets
 	// consisting of only new inputs to the list, to make sure that new
 	// inputs are given a good, isolated chance of being published.
-	//
-	// TODO(yy): this would lead to conflict transactions as the same input
-	// can be used in two sweeping transactions, and our rebroadcaster will
-	// retry the failed one. We should instead understand why the input is
-	// failed in the first place, and start tracking input states in
-	// sweeper to avoid this.
 	var newInputs, retryInputs []txInput
 	for _, input := range cluster.inputs {
 		// Skip inputs that have a minimum publish height that is not
diff --git a/sweep/tx_input_set.go b/sweep/tx_input_set.go
index 70004a802..c42d35f77 100644
--- a/sweep/tx_input_set.go
+++ b/sweep/tx_input_set.go
@@ -3,7 +3,6 @@ package sweep
 import (
 	"fmt"
 	"math"
-	"sort"
 
 	"github.com/btcsuite/btcd/btcutil"
 	"github.com/btcsuite/btcd/txscript"
@@ -171,9 +170,7 @@ func (t *txInputSet) enoughInput() bool {
 // add adds a new input to the set. It returns a bool indicating whether the
 // input was added to the set. An input is rejected if it decreases the tx
 // output value after paying fees.
-func (t *txInputSet) addToState(inp input.Input,
-	constraints addConstraints) *txInputSetState {
-
+func (t *txInputSet) addToState(inp input.Input, constraints addConstraints) *txInputSetState {
 	// Stop if max inputs is reached. Do not count additional wallet inputs,
 	// because we don't know in advance how many we may need.
 	if constraints != constraintsWallet &&
@@ -184,97 +181,64 @@ func (t *txInputSet) addToState(inp input.Input,
 
 	// If the input comes with a required tx out that is below dust, we
 	// won't add it.
-	//
-	// NOTE: only HtlcSecondLevelAnchorInput returns non-nil RequiredTxOut.
 	reqOut := inp.RequiredTxOut()
 	if reqOut != nil {
 		// Fetch the dust limit for this output.
 		dustLimit := lnwallet.DustLimitForSize(len(reqOut.PkScript))
 		if btcutil.Amount(reqOut.Value) < dustLimit {
-			log.Errorf("Rejected input=%v due to dust required "+
-				"output=%v, limit=%v", inp, reqOut.Value,
-				dustLimit)
-
-			// TODO(yy): we should not return here for force
-			// sweeps. This means when sending sweeping request,
-			// one must be careful to not create dust outputs. In
-			// an extreme rare case, where the
-			// minRelayTxFee/discardfee is increased when sending
-			// the request, what's considered non-dust at the
-			// caller side will be dust here, causing a force sweep
-			// to fail.
 			return nil
 		}
 	}
 
 	// Clone the current set state.
-	newSet := t.clone()
+	s := t.clone()
 
 	// Add the new input.
-	newSet.inputs = append(newSet.inputs, inp)
+	s.inputs = append(s.inputs, inp)
 
 	// Add the value of the new input.
 	value := btcutil.Amount(inp.SignDesc().Output.Value)
-	newSet.inputTotal += value
+	s.inputTotal += value
 
 	// Recalculate the tx fee.
-	fee := newSet.weightEstimate(true).fee()
+	fee := s.weightEstimate(true).fee()
 
 	// Calculate the new output value.
 	if reqOut != nil {
-		newSet.requiredOutput += btcutil.Amount(reqOut.Value)
+		s.requiredOutput += btcutil.Amount(reqOut.Value)
 	}
-
-	// NOTE: `changeOutput` could be negative here if this input is using
-	// constraintsForce.
-	newSet.changeOutput = newSet.inputTotal - newSet.requiredOutput - fee
+	s.changeOutput = s.inputTotal - s.requiredOutput - fee
 
 	// Calculate the yield of this input from the change in total tx output
 	// value.
-	inputYield := newSet.totalOutput() - t.totalOutput()
+	inputYield := s.totalOutput() - t.totalOutput()
 
 	switch constraints {
 	// Don't sweep inputs that cost us more to sweep than they give us.
 	case constraintsRegular:
 		if inputYield <= 0 {
-			log.Debugf("Rejected regular input=%v due to negative "+
-				"yield=%v", value, inputYield)
-
 			return nil
 		}
 
 	// For force adds, no further constraints apply.
-	//
-	// NOTE: because the inputs are sorted with force sweeps being placed
-	// at the start of the list, we should never see an input with
-	// constraintsForce come after an input with constraintsRegular. In
-	// other words, though we may have negative `changeOutput` from
-	// including force sweeps, `inputYield` should always increase when
-	// adding regular inputs.
 	case constraintsForce:
-		newSet.force = true
+		s.force = true
 
 	// We are attaching a wallet input to raise the tx output value above
 	// the dust limit.
 	case constraintsWallet:
 		// Skip this wallet input if adding it would lower the output
 		// value.
-		//
-		// TODO(yy): change to inputYield < 0 to allow sweeping for
-		// UTXO aggregation only?
 		if inputYield <= 0 {
-			log.Debugf("Rejected wallet input=%v due to negative "+
-				"yield=%v", value, inputYield)
-
 			return nil
 		}
 
 		// Calculate the total value that we spend in this tx from the
 		// wallet if we'd add this wallet input.
-		newSet.walletInputTotal += value
+		s.walletInputTotal += value
 
 		// In any case, we don't want to lose money by sweeping. If we
-		// don't get more out of the tx than we put in ourselves, do not
+		// don't get more out of the tx then we put in ourselves, do not
 		// add this wallet input. If there is at least one force sweep
 		// in the set, this does no longer apply.
 		//
@@ -286,27 +250,17 @@ func (t *txInputSet) addToState(inp input.Input,
 		// value of the wallet input and what we get out of this
 		// transaction. To prevent attaching and locking a big utxo for
 		// very little benefit.
-		if newSet.force {
-			break
-		}
-
-		// TODO(yy): change from `>=` to `>` to allow non-negative
-		// sweeping - we won't gain more coins from this sweep, but
-		// aggregating small UTXOs.
-		if newSet.walletInputTotal >= newSet.totalOutput() {
-			// TODO(yy): further check this case as it seems we can
-			// never reach here because it'd mean `inputYield` is
-			// already <= 0?
+		if !s.force && s.walletInputTotal >= s.totalOutput() {
 			log.Debugf("Rejecting wallet input of %v, because it "+
 				"would make a negative yielding transaction "+
-				"(%v)", value,
-				newSet.totalOutput()-newSet.walletInputTotal)
+				"(%v)",
+				value, s.totalOutput()-s.walletInputTotal)
 
 			return nil
 		}
 	}
 
-	return &newSet
+	return &s
 }
 
 // add adds a new input to the set. It returns a bool indicating whether the
@@ -380,15 +334,6 @@ func (t *txInputSet) tryAddWalletInputsIfNeeded() error {
 		return err
 	}
 
-	// Sort the UTXOs by putting smaller values at the start of the slice
-	// to avoid locking large UTXO for sweeping.
-	//
-	// TODO(yy): add more choices to CoinSelectionStrategy and use the
-	// configured value here.
-	sort.Slice(utxos, func(i, j int) bool {
-		return utxos[i].Value < utxos[j].Value
-	})
-
 	for _, utxo := range utxos {
 		input, err := createWalletTxInput(utxo)
 		if err != nil {
diff --git a/sweep/txgenerator.go b/sweep/txgenerator.go
index 3d3706303..e1f71e7cd 100644
--- a/sweep/txgenerator.go
+++ b/sweep/txgenerator.go
@@ -115,10 +115,10 @@ func generateInputPartitionings(sweepableInputs []txInput,
 		if !txInputs.enoughInput() {
 			// The change output is always a p2tr here.
 			dl := lnwallet.DustLimitForSize(input.P2TRSize)
-			log.Debugf("Input set value %v (required=%v, "+
-				"change=%v) below dust limit of %v",
-				txInputs.totalOutput(), txInputs.requiredOutput,
-				txInputs.changeOutput, dl)
+			log.Debugf("Set value %v (r=%v, c=%v) below dust "+
+				"limit of %v", txInputs.totalOutput(),
+				txInputs.requiredOutput, txInputs.changeOutput,
+				dl)
 			return sets, nil
 		}
 


Test patch:
diff --git a/channeldb/invoice_test.go b/channeldb/invoice_test.go
index e4d9ffffa..ce2d960b6 100644
--- a/channeldb/invoice_test.go
+++ b/channeldb/invoice_test.go
@@ -2,7 +2,6 @@ package channeldb
 
 import (
 	"bytes"
-	"context"
 	"crypto/rand"
 	"fmt"
 	"math"
@@ -152,7 +151,7 @@ func TestInvoiceWorkflow(t *testing.T) {
 }
 
 func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	// Create a fake invoice which we'll use several times in the tests
@@ -178,18 +177,17 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 		ref = invpkg.InvoiceRefByHash(payHash)
 	}
 
-	ctxb := context.Background()
 	// Add the invoice to the database, this should succeed as there aren't
 	// any existing invoices within the database with the same payment
 	// hash.
-	if _, err := db.AddInvoice(ctxb, fakeInvoice, invPayHash); err != nil {
+	if _, err := db.AddInvoice(fakeInvoice, invPayHash); err != nil {
 		t.Fatalf("unable to find invoice: %v", err)
 	}
 
 	// Attempt to retrieve the invoice which was just added to the
 	// database. It should be found, and the invoice returned should be
 	// identical to the one created above.
-	dbInvoice, err := db.LookupInvoice(ctxb, ref)
+	dbInvoice, err := db.LookupInvoice(ref)
 	if !test.queryPayAddr && !test.queryPayHash {
 		require.ErrorIs(t, err, invpkg.ErrInvoiceNotFound)
 		return
@@ -212,9 +210,9 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 	// now have the settled bit toggle to true and a non-default
 	// SettledDate
 	payAmt := fakeInvoice.Terms.Value * 2
-	_, err = db.UpdateInvoice(ctxb, ref, nil, getUpdateInvoice(payAmt))
+	_, err = db.UpdateInvoice(ref, nil, getUpdateInvoice(payAmt))
 	require.NoError(t, err, "unable to settle invoice")
-	dbInvoice2, err := db.LookupInvoice(ctxb, ref)
+	dbInvoice2, err := db.LookupInvoice(ref)
 	require.NoError(t, err, "unable to fetch invoice")
 	if dbInvoice2.State != invpkg.ContractSettled {
 		t.Fatalf("invoice should now be settled but isn't")
@@ -236,14 +234,14 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 
 	// Attempt to insert generated above again, this should fail as
 	// duplicates are rejected by the processing logic.
-	_, err = db.AddInvoice(ctxb, fakeInvoice, payHash)
+	_, err = db.AddInvoice(fakeInvoice, payHash)
 	require.ErrorIs(t, err, invpkg.ErrDuplicateInvoice)
 
 	// Attempt to look up a non-existent invoice, this should also fail but
 	// with a "not found" error.
 	var fakeHash [32]byte
 	fakeRef := invpkg.InvoiceRefByHash(fakeHash)
-	_, err = db.LookupInvoice(ctxb, fakeRef)
+	_, err = db.LookupInvoice(fakeRef)
 	require.ErrorIs(t, err, invpkg.ErrInvoiceNotFound)
 
 	// Add 10 random invoices.
@@ -258,7 +256,7 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 		}
 
 		hash := invoice.Terms.PaymentPreimage.Hash()
-		if _, err := db.AddInvoice(ctxb, invoice, hash); err != nil {
+		if _, err := db.AddInvoice(invoice, hash); err != nil {
 			t.Fatalf("unable to add invoice %v", err)
 		}
 
@@ -272,7 +270,7 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 		PendingOnly:    false,
 	}
 
-	response, err := db.QueryInvoices(ctxb, query)
+	response, err := db.QueryInvoices(query)
 	require.NoError(t, err, "invoice query failed")
 
 	// The retrieve list of invoices should be identical as since we're
@@ -290,7 +288,7 @@ func testInvoiceWorkflow(t *testing.T, test invWorkflowTest) {
 // TestAddDuplicatePayAddr asserts that the payment addresses of inserted
 // invoices are unique.
 func TestAddDuplicatePayAddr(t *testing.T) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err)
 
 	// Create two invoices with the same payment addr.
@@ -301,16 +299,14 @@ func TestAddDuplicatePayAddr(t *testing.T) {
 	require.NoError(t, err)
 	invoice2.Terms.PaymentAddr = invoice1.Terms.PaymentAddr
 
-	ctxb := context.Background()
-
 	// First insert should succeed.
 	inv1Hash := invoice1.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice1, inv1Hash)
+	_, err = db.AddInvoice(invoice1, inv1Hash)
 	require.NoError(t, err)
 
 	// Second insert should fail with duplicate payment addr.
 	inv2Hash := invoice2.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice2, inv2Hash)
+	_, err = db.AddInvoice(invoice2, inv2Hash)
 	require.Error(t, err, invpkg.ErrDuplicatePayAddr)
 }
 
@@ -318,7 +314,7 @@ func TestAddDuplicatePayAddr(t *testing.T) {
 // addresses to be inserted if they are blank to support JIT legacy keysend
 // invoices.
 func TestAddDuplicateKeysendPayAddr(t *testing.T) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err)
 
 	// Create two invoices with the same _blank_ payment addr.
@@ -330,16 +326,14 @@ func TestAddDuplicateKeysendPayAddr(t *testing.T) {
 	require.NoError(t, err)
 	invoice2.Terms.PaymentAddr = invpkg.BlankPayAddr
 
-	ctxb := context.Background()
-
 	// Inserting both should succeed without a duplicate payment address
 	// failure.
 	inv1Hash := invoice1.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice1, inv1Hash)
+	_, err = db.AddInvoice(invoice1, inv1Hash)
 	require.NoError(t, err)
 
 	inv2Hash := invoice2.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice2, inv2Hash)
+	_, err = db.AddInvoice(invoice2, inv2Hash)
 	require.NoError(t, err)
 
 	// Querying for each should succeed. Here we use hash+addr refs since
@@ -347,12 +341,12 @@ func TestAddDuplicateKeysendPayAddr(t *testing.T) {
 	// invoices, so if both succeed we can be assured they aren't included
 	// in the payment address index.
 	ref1 := invpkg.InvoiceRefByHashAndAddr(inv1Hash, invpkg.BlankPayAddr)
-	dbInv1, err := db.LookupInvoice(ctxb, ref1)
+	dbInv1, err := db.LookupInvoice(ref1)
 	require.NoError(t, err)
 	require.Equal(t, invoice1, &dbInv1)
 
 	ref2 := invpkg.InvoiceRefByHashAndAddr(inv2Hash, invpkg.BlankPayAddr)
-	dbInv2, err := db.LookupInvoice(ctxb, ref2)
+	dbInv2, err := db.LookupInvoice(ref2)
 	require.NoError(t, err)
 	require.Equal(t, invoice2, &dbInv2)
 }
@@ -362,7 +356,7 @@ func TestAddDuplicateKeysendPayAddr(t *testing.T) {
 // ensures that the HTLC's payment hash always matches the payment hash in the
 // returned invoice.
 func TestFailInvoiceLookupMPPPayAddrOnly(t *testing.T) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err)
 
 	// Create and insert a random invoice.
@@ -371,9 +365,7 @@ func TestFailInvoiceLookupMPPPayAddrOnly(t *testing.T) {
 
 	payHash := invoice.Terms.PaymentPreimage.Hash()
 	payAddr := invoice.Terms.PaymentAddr
-
-	ctxb := context.Background()
-	_, err = db.AddInvoice(ctxb, invoice, payHash)
+	_, err = db.AddInvoice(invoice, payHash)
 	require.NoError(t, err)
 
 	// Modify the queried payment hash to be invalid.
@@ -384,30 +376,29 @@ func TestFailInvoiceLookupMPPPayAddrOnly(t *testing.T) {
 	// legacy/MPP invoices, as this guarantees that the preimage is valid
 	// for the given HTLC.
 	ref := invpkg.InvoiceRefByHashAndAddr(payHash, payAddr)
-	_, err = db.LookupInvoice(ctxb, ref)
+	_, err = db.LookupInvoice(ref)
 	require.Equal(t, invpkg.ErrInvoiceNotFound, err)
 }
 
 // TestInvRefEquivocation asserts that retrieving or updating an invoice using
 // an equivocating InvoiceRef results in ErrInvRefEquivocation.
 func TestInvRefEquivocation(t *testing.T) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err)
 
 	// Add two random invoices.
 	invoice1, err := randInvoice(1000)
 	require.NoError(t, err)
 
-	ctxb := context.Background()
 	inv1Hash := invoice1.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice1, inv1Hash)
+	_, err = db.AddInvoice(invoice1, inv1Hash)
 	require.NoError(t, err)
 
 	invoice2, err := randInvoice(2000)
 	require.NoError(t, err)
 
 	inv2Hash := invoice2.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice2, inv2Hash)
+	_, err = db.AddInvoice(invoice2, inv2Hash)
 	require.NoError(t, err)
 
 	// Now, query using invoice 1's payment address, but invoice 2's payment
@@ -416,7 +407,7 @@ func TestInvRefEquivocation(t *testing.T) {
 	ref := invpkg.InvoiceRefByHashAndAddr(
 		inv2Hash, invoice1.Terms.PaymentAddr,
 	)
-	_, err = db.LookupInvoice(ctxb, ref)
+	_, err = db.LookupInvoice(ref)
 	require.Error(t, err, invpkg.ErrInvRefEquivocation)
 
 	// The same error should be returned when updating an equivocating
@@ -424,7 +415,7 @@ func TestInvRefEquivocation(t *testing.T) {
 	nop := func(_ *invpkg.Invoice) (*invpkg.InvoiceUpdateDesc, error) {
 		return nil, nil
 	}
-	_, err = db.UpdateInvoice(ctxb, ref, nil, nop)
+	_, err = db.UpdateInvoice(ref, nil, nop)
 	require.Error(t, err, invpkg.ErrInvRefEquivocation)
 }
 
@@ -433,7 +424,7 @@ func TestInvRefEquivocation(t *testing.T) {
 func TestInvoiceCancelSingleHtlc(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	preimage := lntypes.Preimage{1}
@@ -448,8 +439,7 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
 		},
 	}
 
-	ctxb := context.Background()
-	if _, err := db.AddInvoice(ctxb, testInvoice, paymentHash); err != nil {
+	if _, err := db.AddInvoice(testInvoice, paymentHash); err != nil {
 		t.Fatalf("unable to find invoice: %v", err)
 	}
 
@@ -477,7 +467,7 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
 	}
 
 	ref := invpkg.InvoiceRefByHash(paymentHash)
-	invoice, err := db.UpdateInvoice(ctxb, ref, nil, callback)
+	invoice, err := db.UpdateInvoice(ref, nil, callback)
 	require.NoError(t, err, "unable to add invoice htlc")
 	if len(invoice.Htlcs) != 1 {
 		t.Fatalf("expected the htlc to be added")
@@ -498,7 +488,7 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
 	}
 
 	// Cancel the htlc again.
-	invoice, err = db.UpdateInvoice(ctxb, ref, nil, callback)
+	invoice, err = db.UpdateInvoice(ref, nil, callback)
 	require.NoError(t, err, "unable to cancel htlc")
 	if len(invoice.Htlcs) != 1 {
 		t.Fatalf("expected the htlc to be present")
@@ -514,7 +504,7 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
 func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.NoError(t, err, "unable to make test db: %v", err)
 
 	// We'll start out by creating an invoice and writing it to the DB.
@@ -526,10 +516,9 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 	// preimages.
 	invoice.Terms.Features = ampFeatures
 
-	ctxb := context.Background()
 	preimage := *invoice.Terms.PaymentPreimage
 	payHash := preimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice, payHash)
+	_, err = db.AddInvoice(invoice, payHash)
 	require.Nil(t, err)
 
 	// Add two HTLC sets, one with one HTLC and the other with two.
@@ -542,19 +531,19 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 
 	// The first set ID with a single HTLC added.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID1),
+		ref, (*invpkg.SetID)(setID1),
 		updateAcceptAMPHtlc(0, amt, setID1, true),
 	)
 	require.Nil(t, err)
 
 	// The second set ID with two HTLCs added.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		updateAcceptAMPHtlc(1, amt, setID2, true),
 	)
 	require.Nil(t, err)
 	dbInvoice, err := db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		updateAcceptAMPHtlc(2, amt, setID2, true),
 	)
 	require.Nil(t, err)
@@ -578,10 +567,10 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 	// Now we'll cancel a single invoice, and assert that the amount paid
 	// is decremented, and the state for that HTLC set reflects that is
 	// been cancelled.
-	_, err = db.UpdateInvoice(ctxb, ref, (*invpkg.SetID)(setID1), callback)
+	_, err = db.UpdateInvoice(ref, (*invpkg.SetID)(setID1), callback)
 	require.NoError(t, err, "unable to cancel htlc")
 
-	freshInvoice, err := db.LookupInvoice(ctxb, ref)
+	freshInvoice, err := db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -625,7 +614,7 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 
 	// Next, we'll cancel the _other_ HTLCs active, but we'll do them one
 	// by one.
-	_, err = db.UpdateInvoice(ctxb, ref, (*invpkg.SetID)(setID2),
+	_, err = db.UpdateInvoice(ref, (*invpkg.SetID)(setID2),
 		func(invoice *invpkg.Invoice) (*invpkg.InvoiceUpdateDesc,
 			error) {
 
@@ -639,7 +628,7 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 		})
 	require.NoError(t, err, "unable to cancel htlc")
 
-	freshInvoice, err = db.LookupInvoice(ctxb, ref)
+	freshInvoice, err = db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -668,10 +657,10 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 
 	// Now we'll cancel the final HTLC, which should cause all the active
 	// HTLCs to transition to the cancelled state.
-	_, err = db.UpdateInvoice(ctxb, ref, (*invpkg.SetID)(setID2), callback)
+	_, err = db.UpdateInvoice(ref, (*invpkg.SetID)(setID2), callback)
 	require.NoError(t, err, "unable to cancel htlc")
 
-	freshInvoice, err = db.LookupInvoice(ctxb, ref)
+	freshInvoice, err = db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -692,11 +681,10 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
 func TestInvoiceAddTimeSeries(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.NoError(t, err, "unable to make test db")
 
-	ctxb := context.Background()
-	_, err = db.InvoicesAddedSince(ctxb, 0)
+	_, err = db.InvoicesAddedSince(0)
 	require.NoError(t, err)
 
 	// We'll start off by creating 20 random invoices, and inserting them
@@ -711,8 +699,8 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
 		}
 
 		paymentHash := invoice.Terms.PaymentPreimage.Hash()
-		_, err = db.AddInvoice(ctxb, invoice, paymentHash)
-		if err != nil {
+
+		if _, err := db.AddInvoice(invoice, paymentHash); err != nil {
 			t.Fatalf("unable to add invoice %v", err)
 		}
 
@@ -755,7 +743,7 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
 	}
 
 	for i, query := range addQueries {
-		resp, err := db.InvoicesAddedSince(ctxb, query.sinceAddIndex)
+		resp, err := db.InvoicesAddedSince(query.sinceAddIndex)
 		if err != nil {
 			t.Fatalf("unable to query: %v", err)
 		}
@@ -770,7 +758,7 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
 		}
 	}
 
-	_, err = db.InvoicesSettledSince(ctxb, 0)
+	_, err = db.InvoicesSettledSince(0)
 	require.NoError(t, err)
 
 	var settledInvoices []invpkg.Invoice
@@ -783,7 +771,7 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
 
 		ref := invpkg.InvoiceRefByHash(paymentHash)
 		_, err := db.UpdateInvoice(
-			ctxb, ref, nil, getUpdateInvoice(invoice.Terms.Value),
+			ref, nil, getUpdateInvoice(invoice.Terms.Value),
 		)
 		if err != nil {
 			t.Fatalf("unable to settle invoice: %v", err)
@@ -824,9 +812,7 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
 	}
 
 	for i, query := range settleQueries {
-		resp, err := db.InvoicesSettledSince(
-			ctxb, query.sinceSettleIndex,
-		)
+		resp, err := db.InvoicesSettledSince(query.sinceSettleIndex)
 		if err != nil {
 			t.Fatalf("unable to query: %v", err)
 		}
@@ -850,7 +836,7 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	t.Parallel()
 
 	testClock := clock.NewTestClock(testNow)
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.Nil(t, err)
 
 	// First, we'll make a sample invoice that'll be paid to several times
@@ -862,10 +848,9 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 
 	// Add the invoice to the DB, we use a dummy payment hash here but the
 	// invoice will have a valid payment address set.
-	ctxb := context.Background()
 	preimage := *testInvoice.Terms.PaymentPreimage
 	payHash := preimage.Hash()
-	_, err = db.AddInvoice(ctxb, testInvoice, payHash)
+	_, err = db.AddInvoice(testInvoice, payHash)
 	require.Nil(t, err)
 
 	// Now that we have the invoice, we'll simulate 3 different HTLC sets
@@ -879,17 +864,17 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 		payHash, testInvoice.Terms.PaymentAddr,
 	)
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID1),
+		ref, (*invpkg.SetID)(setID1),
 		updateAcceptAMPHtlc(1, amt, setID1, true),
 	)
 	require.Nil(t, err)
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		updateAcceptAMPHtlc(2, amt, setID2, true),
 	)
 	require.Nil(t, err)
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID3),
+		ref, (*invpkg.SetID)(setID3),
 		updateAcceptAMPHtlc(3, amt, setID3, true),
 	)
 	require.Nil(t, err)
@@ -903,7 +888,7 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	refNoHtlcs := invpkg.InvoiceRefByAddrBlankHtlc(
 		testInvoice.Terms.PaymentAddr,
 	)
-	invoiceNoHTLCs, err := db.LookupInvoice(ctxb, refNoHtlcs)
+	invoiceNoHTLCs, err := db.LookupInvoice(refNoHtlcs)
 	require.Nil(t, err)
 
 	require.Equal(t, 0, len(invoiceNoHTLCs.Htlcs))
@@ -912,7 +897,7 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	// above.
 	for i, setID := range []*[32]byte{setID1, setID2, setID3} {
 		refFiltered := invpkg.InvoiceRefBySetIDFiltered(*setID)
-		invoiceFiltered, err := db.LookupInvoice(ctxb, refFiltered)
+		invoiceFiltered, err := db.LookupInvoice(refFiltered)
 		require.Nil(t, err)
 
 		// Only a single HTLC should be present.
@@ -930,21 +915,21 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	// Now that we know the invoices are in the proper state, we'll settle
 	// them on by one in distinct updates.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID1),
+		ref, (*invpkg.SetID)(setID1),
 		getUpdateInvoiceAMPSettle(
 			setID1, preimage, models.CircuitKey{HtlcID: 1},
 		),
 	)
 	require.Nil(t, err)
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		getUpdateInvoiceAMPSettle(
 			setID2, preimage, models.CircuitKey{HtlcID: 2},
 		),
 	)
 	require.Nil(t, err)
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID3),
+		ref, (*invpkg.SetID)(setID3),
 		getUpdateInvoiceAMPSettle(
 			setID3, preimage, models.CircuitKey{HtlcID: 3},
 		),
@@ -955,14 +940,14 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	// settle index was updated properly by obtaining all the currently
 	// settled invoices in the time series. We use a value of 1 here to
 	// ensure we get _all_ the invoices back.
-	settledInvoices, err := db.InvoicesSettledSince(ctxb, 1)
+	settledInvoices, err := db.InvoicesSettledSince(1)
 	require.Nil(t, err)
 
 	// To get around the settle index quirk, we'll fetch the very first
 	// invoice in the HTLC filtered mode and append it to the set of
 	// invoices.
 	firstInvoice, err := db.LookupInvoice(
-		ctxb, invpkg.InvoiceRefBySetIDFiltered(*setID1),
+		invpkg.InvoiceRefBySetIDFiltered(*setID1),
 	)
 	require.Nil(t, err)
 	settledInvoices = append(
@@ -997,13 +982,13 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 	// If we attempt to look up the invoice by the payment addr, with all
 	// the HTLCs, the main invoice should have 3 HTLCs present.
 	refWithHtlcs := invpkg.InvoiceRefByAddr(testInvoice.Terms.PaymentAddr)
-	invoiceWithHTLCs, err := db.LookupInvoice(ctxb, refWithHtlcs)
+	invoiceWithHTLCs, err := db.LookupInvoice(refWithHtlcs)
 	require.Nil(t, err)
 	require.Equal(t, numInvoices, len(invoiceWithHTLCs.Htlcs))
 
 	// Finally, delete the invoice. If we query again, then nothing should
 	// be found.
-	err = db.DeleteInvoice(ctxb, []invpkg.InvoiceDeleteRef{
+	err = db.DeleteInvoice([]invpkg.InvoiceDeleteRef{
 		{
 			PayHash:  payHash,
 			PayAddr:  &testInvoice.Terms.PaymentAddr,
@@ -1018,7 +1003,7 @@ func TestSettleIndexAmpPayments(t *testing.T) {
 func TestScanInvoices(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	var invoices map[lntypes.Hash]*invpkg.Invoice
@@ -1043,9 +1028,8 @@ func TestScanInvoices(t *testing.T) {
 		return nil
 	}
 
-	ctxb := context.Background()
 	// With an empty DB we expect to not scan any invoices.
-	require.NoError(t, db.ScanInvoices(ctxb, scanFunc, reset))
+	require.NoError(t, db.ScanInvoices(scanFunc, reset))
 	require.Equal(t, 0, len(invoices))
 	require.Equal(t, 0, callCount)
 	require.Equal(t, 1, resetCount)
@@ -1062,12 +1046,12 @@ func TestScanInvoices(t *testing.T) {
 		paymentHash := invoice.Terms.PaymentPreimage.Hash()
 		testInvoices[paymentHash] = invoice
 
-		_, err = db.AddInvoice(ctxb, invoice, paymentHash)
+		_, err = db.AddInvoice(invoice, paymentHash)
 		require.NoError(t, err)
 	}
 
 	resetCount = 0
-	require.NoError(t, db.ScanInvoices(ctxb, scanFunc, reset))
+	require.NoError(t, db.ScanInvoices(scanFunc, reset))
 	require.Equal(t, numInvoices, callCount)
 	require.Equal(t, testInvoices, invoices)
 	require.Equal(t, 1, resetCount)
@@ -1079,7 +1063,7 @@ func TestScanInvoices(t *testing.T) {
 func TestDuplicateSettleInvoice(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.NoError(t, err, "unable to make test db")
 
 	// We'll start out by creating an invoice and writing it to the DB.
@@ -1089,16 +1073,13 @@ func TestDuplicateSettleInvoice(t *testing.T) {
 
 	payHash := invoice.Terms.PaymentPreimage.Hash()
 
-	ctxb := context.Background()
-	if _, err := db.AddInvoice(ctxb, invoice, payHash); err != nil {
+	if _, err := db.AddInvoice(invoice, payHash); err != nil {
 		t.Fatalf("unable to add invoice %v", err)
 	}
 
 	// With the invoice in the DB, we'll now attempt to settle the invoice.
 	ref := invpkg.InvoiceRefByHash(payHash)
-	dbInvoice, err := db.UpdateInvoice(
-		ctxb, ref, nil, getUpdateInvoice(amt),
-	)
+	dbInvoice, err := db.UpdateInvoice(ref, nil, getUpdateInvoice(amt))
 	require.NoError(t, err, "unable to settle invoice")
 
 	// We'll update what we expect the settle invoice to be so that our
@@ -1122,7 +1103,7 @@ func TestDuplicateSettleInvoice(t *testing.T) {
 
 	// If we try to settle the invoice again, then we should get the very
 	// same invoice back, but with an error this time.
-	dbInvoice, err = db.UpdateInvoice(ctxb, ref, nil, getUpdateInvoice(amt))
+	dbInvoice, err = db.UpdateInvoice(ref, nil, getUpdateInvoice(amt))
 	require.ErrorIs(t, err, invpkg.ErrInvoiceAlreadySettled)
 
 	if dbInvoice == nil {
@@ -1140,7 +1121,7 @@ func TestDuplicateSettleInvoice(t *testing.T) {
 func TestQueryInvoices(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.NoError(t, err, "unable to make test db")
 
 	// To begin the test, we'll add 50 invoices to the database. We'll
@@ -1151,7 +1132,6 @@ func TestQueryInvoices(t *testing.T) {
 	var invoices []invpkg.Invoice
 	var pendingInvoices []invpkg.Invoice
 
-	ctxb := context.Background()
 	for i := 1; i <= numInvoices; i++ {
 		amt := lnwire.MilliSatoshi(i)
 		invoice, err := randInvoice(amt)
@@ -1164,9 +1144,7 @@ func TestQueryInvoices(t *testing.T) {
 
 		paymentHash := invoice.Terms.PaymentPreimage.Hash()
 
-		if _, err := db.AddInvoice(
-			ctxb, invoice, paymentHash,
-		); err != nil {
+		if _, err := db.AddInvoice(invoice, paymentHash); err != nil {
 			t.Fatalf("unable to add invoice: %v", err)
 		}
 
@@ -1174,7 +1152,7 @@ func TestQueryInvoices(t *testing.T) {
 		if i%2 == 0 {
 			ref := invpkg.InvoiceRefByHash(paymentHash)
 			_, err := db.UpdateInvoice(
-				ctxb, ref, nil, getUpdateInvoice(amt),
+				ref, nil, getUpdateInvoice(amt),
 			)
 			if err != nil {
 				t.Fatalf("unable to settle invoice: %v", err)
@@ -1522,7 +1500,7 @@ func TestQueryInvoices(t *testing.T) {
 	}
 
 	for i, testCase := range testCases {
-		response, err := db.QueryInvoices(ctxb, testCase.query)
+		response, err := db.QueryInvoices(testCase.query)
 		if err != nil {
 			t.Fatalf("unable to query invoice database: %v", err)
 		}
@@ -1573,7 +1551,7 @@ func getUpdateInvoice(amt lnwire.MilliSatoshi) invpkg.InvoiceUpdateCallback {
 func TestCustomRecords(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	preimage := lntypes.Preimage{1}
@@ -1588,8 +1566,7 @@ func TestCustomRecords(t *testing.T) {
 		},
 	}
 
-	ctxb := context.Background()
-	if _, err := db.AddInvoice(ctxb, testInvoice, paymentHash); err != nil {
+	if _, err := db.AddInvoice(testInvoice, paymentHash); err != nil {
 		t.Fatalf("unable to add invoice: %v", err)
 	}
 
@@ -1621,12 +1598,12 @@ func TestCustomRecords(t *testing.T) {
 		}, nil
 	}
 
-	_, err = db.UpdateInvoice(ctxb, ref, nil, callback)
+	_, err = db.UpdateInvoice(ref, nil, callback)
 	require.NoError(t, err, "unable to add invoice htlc")
 
 	// Retrieve the invoice from that database and verify that the custom
 	// records are present.
-	dbInvoice, err := db.LookupInvoice(ctxb, ref)
+	dbInvoice, err := db.LookupInvoice(ref)
 	require.NoError(t, err, "unable to lookup invoice")
 
 	if len(dbInvoice.Htlcs) != 1 {
@@ -1651,7 +1628,7 @@ func TestInvoiceHtlcAMPFields(t *testing.T) {
 }
 
 func testInvoiceHtlcAMPFields(t *testing.T, isAMP bool) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.Nil(t, err)
 
 	testInvoice, err := randInvoice(1000)
@@ -1661,9 +1638,8 @@ func testInvoiceHtlcAMPFields(t *testing.T, isAMP bool) {
 		testInvoice.Terms.Features = ampFeatures
 	}
 
-	ctxb := context.Background()
 	payHash := testInvoice.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, testInvoice, payHash)
+	_, err = db.AddInvoice(testInvoice, payHash)
 	require.Nil(t, err)
 
 	// Accept an htlc with custom records on this invoice.
@@ -1703,12 +1679,12 @@ func testInvoiceHtlcAMPFields(t *testing.T, isAMP bool) {
 	}
 
 	ref := invpkg.InvoiceRefByHash(payHash)
-	_, err = db.UpdateInvoice(ctxb, ref, nil, callback)
+	_, err = db.UpdateInvoice(ref, nil, callback)
 	require.Nil(t, err)
 
 	// Retrieve the invoice from that database and verify that the AMP
 	// fields are as expected.
-	dbInvoice, err := db.LookupInvoice(ctxb, ref)
+	dbInvoice, err := db.LookupInvoice(ref)
 	require.Nil(t, err)
 
 	require.Equal(t, 1, len(dbInvoice.Htlcs))
@@ -1853,7 +1829,7 @@ func TestHTLCSet(t *testing.T) {
 // TestAddInvoiceWithHTLCs asserts that you can't insert an invoice that already
 // has HTLCs.
 func TestAddInvoiceWithHTLCs(t *testing.T) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.Nil(t, err)
 
 	testInvoice, err := randInvoice(1000)
@@ -1863,7 +1839,7 @@ func TestAddInvoiceWithHTLCs(t *testing.T) {
 	testInvoice.Htlcs[key] = &invpkg.InvoiceHTLC{}
 
 	payHash := testInvoice.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(context.Background(), testInvoice, payHash)
+	_, err = db.AddInvoice(testInvoice, payHash)
 	require.Equal(t, invpkg.ErrInvoiceHasHtlcs, err)
 }
 
@@ -1872,7 +1848,7 @@ func TestAddInvoiceWithHTLCs(t *testing.T) {
 // that invoices with duplicate set ids are disallowed.
 func TestSetIDIndex(t *testing.T) {
 	testClock := clock.NewTestClock(testNow)
-	db, err := MakeTestInvoiceDB(t, OptionClock(testClock))
+	db, err := MakeTestDB(t, OptionClock(testClock))
 	require.Nil(t, err)
 
 	// We'll start out by creating an invoice and writing it to the DB.
@@ -1884,10 +1860,9 @@ func TestSetIDIndex(t *testing.T) {
 	// preimages.
 	invoice.Terms.Features = ampFeatures
 
-	ctxb := context.Background()
 	preimage := *invoice.Terms.PaymentPreimage
 	payHash := preimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice, payHash)
+	_, err = db.AddInvoice(invoice, payHash)
 	require.Nil(t, err)
 
 	setID := &[32]byte{1}
@@ -1898,7 +1873,7 @@ func TestSetIDIndex(t *testing.T) {
 		payHash, invoice.Terms.PaymentAddr,
 	)
 	dbInvoice, err := db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID),
+		ref, (*invpkg.SetID)(setID),
 		updateAcceptAMPHtlc(0, amt, setID, true),
 	)
 	require.Nil(t, err)
@@ -1926,7 +1901,7 @@ func TestSetIDIndex(t *testing.T) {
 
 	// Now lookup the invoice by set id and see that we get the same one.
 	refBySetID := invpkg.InvoiceRefBySetID(*setID)
-	dbInvoiceBySetID, err := db.LookupInvoice(ctxb, refBySetID)
+	dbInvoiceBySetID, err := db.LookupInvoice(refBySetID)
 	require.Nil(t, err)
 	require.Equal(t, invoice, &dbInvoiceBySetID)
 
@@ -1940,14 +1915,14 @@ func TestSetIDIndex(t *testing.T) {
 	invoice2.Terms.Features = ampFeatures
 
 	payHash2 := invoice2.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice2, payHash2)
+	_, err = db.AddInvoice(invoice2, payHash2)
 	require.Nil(t, err)
 
 	ref2 := invpkg.InvoiceRefByHashAndAddr(
 		payHash2, invoice2.Terms.PaymentAddr,
 	)
 	_, err = db.UpdateInvoice(
-		ctxb, ref2, (*invpkg.SetID)(setID),
+		ref2, (*invpkg.SetID)(setID),
 		updateAcceptAMPHtlc(0, amt, setID, true),
 	)
 	require.Equal(t, invpkg.ErrDuplicateSetID{SetID: *setID}, err)
@@ -1957,12 +1932,12 @@ func TestSetIDIndex(t *testing.T) {
 	setID2 := &[32]byte{2}
 
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		updateAcceptAMPHtlc(1, amt, setID2, false),
 	)
 	require.Nil(t, err)
 	dbInvoice, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		updateAcceptAMPHtlc(2, amt, setID2, false),
 	)
 	require.Nil(t, err)
@@ -1997,7 +1972,7 @@ func TestSetIDIndex(t *testing.T) {
 
 	// Since UpdateInvoice will only return the sub-set of updated HTLcs,
 	// we'll query again to ensure we get the full set of HTLCs returned.
-	freshInvoice, err := db.LookupInvoice(ctxb, ref)
+	freshInvoice, err := db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -2007,14 +1982,14 @@ func TestSetIDIndex(t *testing.T) {
 	// Now lookup the invoice by second set id and see that we get the same
 	// index, including the htlcs under the first set id.
 	refBySetID = invpkg.InvoiceRefBySetID(*setID2)
-	dbInvoiceBySetID, err = db.LookupInvoice(ctxb, refBySetID)
+	dbInvoiceBySetID, err = db.LookupInvoice(refBySetID)
 	require.Nil(t, err)
 	require.Equal(t, invoice, &dbInvoiceBySetID)
 
 	// Now attempt to settle a non-existent HTLC set, this set ID is the
 	// zero setID so it isn't used for anything internally.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, nil,
+		ref, nil,
 		getUpdateInvoiceAMPSettle(
 			&[32]byte{}, [32]byte{},
 			models.CircuitKey{HtlcID: 99},
@@ -2026,14 +2001,14 @@ func TestSetIDIndex(t *testing.T) {
 	// the accepted state and shouldn't be canceled, since we permit an
 	// invoice to be settled multiple times.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID),
+		ref, (*invpkg.SetID)(setID),
 		getUpdateInvoiceAMPSettle(
 			setID, preimage, models.CircuitKey{HtlcID: 0},
 		),
 	)
 	require.Nil(t, err)
 
-	freshInvoice, err = db.LookupInvoice(ctxb, ref)
+	freshInvoice, err = db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -2058,7 +2033,7 @@ func TestSetIDIndex(t *testing.T) {
 	// If we try to settle the same set ID again, then we should get an
 	// error, as it's already been settled.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID),
+		ref, (*invpkg.SetID)(setID),
 		getUpdateInvoiceAMPSettle(
 			setID, preimage, models.CircuitKey{HtlcID: 0},
 		),
@@ -2070,7 +2045,7 @@ func TestSetIDIndex(t *testing.T) {
 	// settle an invoice with a new setID after one has already been fully
 	// settled.
 	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID2),
+		ref, (*invpkg.SetID)(setID2),
 		getUpdateInvoiceAMPSettle(
 			setID2, preimage, models.CircuitKey{HtlcID: 1},
 			models.CircuitKey{HtlcID: 2},
@@ -2078,7 +2053,7 @@ func TestSetIDIndex(t *testing.T) {
 	)
 	require.Nil(t, err)
 
-	freshInvoice, err = db.LookupInvoice(ctxb, ref)
+	freshInvoice, err = db.LookupInvoice(ref)
 	require.Nil(t, err)
 	dbInvoice = &freshInvoice
 
@@ -2102,7 +2077,7 @@ func TestSetIDIndex(t *testing.T) {
 
 	// Lastly, querying for an unknown set id should fail.
 	refUnknownSetID := invpkg.InvoiceRefBySetID([32]byte{})
-	_, err = db.LookupInvoice(ctxb, refUnknownSetID)
+	_, err = db.LookupInvoice(refUnknownSetID)
 	require.Equal(t, invpkg.ErrInvoiceNotFound, err)
 }
 
@@ -2214,24 +2189,22 @@ func getUpdateInvoiceAMPSettle(setID *[32]byte, preimage [32]byte,
 func TestUnexpectedInvoicePreimage(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	invoice, err := randInvoice(lnwire.MilliSatoshi(100))
 	require.NoError(t, err)
 
-	ctxb := context.Background()
-
 	// Add a random invoice indexed by payment hash and payment addr.
 	paymentHash := invoice.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(ctxb, invoice, paymentHash)
+	_, err = db.AddInvoice(invoice, paymentHash)
 	require.NoError(t, err)
 
 	// Attempt to update the invoice by pay addr only. This will fail since,
 	// in order to settle an MPP invoice, the InvoiceRef must present a
 	// payment hash against which to validate the preimage.
 	_, err = db.UpdateInvoice(
-		ctxb, invpkg.InvoiceRefByAddr(invoice.Terms.PaymentAddr), nil,
+		invpkg.InvoiceRefByAddr(invoice.Terms.PaymentAddr), nil,
 		getUpdateInvoice(invoice.Terms.Value),
 	)
 
@@ -2272,7 +2245,7 @@ func TestUpdateHTLCPreimages(t *testing.T) {
 }
 
 func testUpdateHTLCPreimages(t *testing.T, test updateHTLCPreimageTestCase) {
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	// We'll start out by creating an invoice and writing it to the DB.
@@ -2287,8 +2260,7 @@ func testUpdateHTLCPreimages(t *testing.T, test updateHTLCPreimageTestCase) {
 	// preimages.
 	invoice.Terms.Features = ampFeatures
 
-	ctxb := context.Background()
-	_, err = db.AddInvoice(ctxb, invoice, payHash)
+	_, err = db.AddInvoice(invoice, payHash)
 	require.Nil(t, err)
 
 	setID := &[32]byte{1}
@@ -2297,7 +2269,7 @@ func testUpdateHTLCPreimages(t *testing.T, test updateHTLCPreimageTestCase) {
 	// invoice.
 	ref := invpkg.InvoiceRefByAddr(invoice.Terms.PaymentAddr)
 	dbInvoice, err := db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID),
+		ref, (*invpkg.SetID)(setID),
 		updateAcceptAMPHtlc(0, amt, setID, true),
 	)
 	require.Nil(t, err)
@@ -2333,9 +2305,7 @@ func testUpdateHTLCPreimages(t *testing.T, test updateHTLCPreimageTestCase) {
 	}
 
 	// Now settle the HTLC set and assert the resulting error.
-	_, err = db.UpdateInvoice(
-		ctxb, ref, (*invpkg.SetID)(setID), updateInvoice,
-	)
+	_, err = db.UpdateInvoice(ref, (*invpkg.SetID)(setID), updateInvoice)
 	require.Equal(t, test.expError, err)
 }
 
@@ -3013,26 +2983,25 @@ func testUpdateHTLC(t *testing.T, test updateHTLCTest) {
 func TestDeleteInvoices(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	// Add some invoices to the test db.
 	numInvoices := 3
 	invoicesToDelete := make([]invpkg.InvoiceDeleteRef, numInvoices)
 
-	ctxb := context.Background()
 	for i := 0; i < numInvoices; i++ {
 		invoice, err := randInvoice(lnwire.MilliSatoshi(i + 1))
 		require.NoError(t, err)
 
 		paymentHash := invoice.Terms.PaymentPreimage.Hash()
-		addIndex, err := db.AddInvoice(ctxb, invoice, paymentHash)
+		addIndex, err := db.AddInvoice(invoice, paymentHash)
 		require.NoError(t, err)
 
 		// Settle the second invoice.
 		if i == 1 {
 			invoice, err = db.UpdateInvoice(
-				ctxb, invpkg.InvoiceRefByHash(paymentHash), nil,
+				invpkg.InvoiceRefByHash(paymentHash), nil,
 				getUpdateInvoice(invoice.Terms.Value),
 			)
 			require.NoError(t, err, "unable to settle invoice")
@@ -3057,14 +3026,14 @@ func TestDeleteInvoices(t *testing.T) {
 		}
 
 		// Check that we really have 3 invoices.
-		response, err := db.QueryInvoices(ctxb, query)
+		response, err := db.QueryInvoices(query)
 		require.NoError(t, err)
 		require.Equal(t, count, len(response.Invoices))
 	}
 
 	// XOR one byte of one of the references' hash and attempt to delete.
 	invoicesToDelete[0].PayHash[2] ^= 3
-	require.Error(t, db.DeleteInvoice(ctxb, invoicesToDelete))
+	require.Error(t, db.DeleteInvoice(invoicesToDelete))
 	assertInvoiceCount(3)
 
 	// Restore the hash.
@@ -3073,7 +3042,7 @@ func TestDeleteInvoices(t *testing.T) {
 	// XOR the second invoice's payment settle index as it is settled, and
 	// attempt to delete.
 	invoicesToDelete[1].SettleIndex ^= 11
-	require.Error(t, db.DeleteInvoice(ctxb, invoicesToDelete))
+	require.Error(t, db.DeleteInvoice(invoicesToDelete))
 	assertInvoiceCount(3)
 
 	// Restore the settle index.
@@ -3081,14 +3050,14 @@ func TestDeleteInvoices(t *testing.T) {
 
 	// XOR the add index for one of the references and attempt to delete.
 	invoicesToDelete[2].AddIndex ^= 13
-	require.Error(t, db.DeleteInvoice(ctxb, invoicesToDelete))
+	require.Error(t, db.DeleteInvoice(invoicesToDelete))
 	assertInvoiceCount(3)
 
 	// Restore the add index.
 	invoicesToDelete[2].AddIndex ^= 13
 
 	// Delete should succeed with all the valid references.
-	require.NoError(t, db.DeleteInvoice(ctxb, invoicesToDelete))
+	require.NoError(t, db.DeleteInvoice(invoicesToDelete))
 	assertInvoiceCount(0)
 }
 
@@ -3097,7 +3066,7 @@ func TestDeleteInvoices(t *testing.T) {
 func TestAddInvoiceInvalidFeatureDeps(t *testing.T) {
 	t.Parallel()
 
-	db, err := MakeTestInvoiceDB(t)
+	db, err := MakeTestDB(t)
 	require.NoError(t, err, "unable to make test db")
 
 	invoice, err := randInvoice(500)
@@ -3112,7 +3081,7 @@ func TestAddInvoiceInvalidFeatureDeps(t *testing.T) {
 	)
 
 	hash := invoice.Terms.PaymentPreimage.Hash()
-	_, err = db.AddInvoice(context.Background(), invoice, hash)
+	_, err = db.AddInvoice(invoice, hash)
 	require.Error(t, err, feature.NewErrMissingFeatureDep(
 		lnwire.PaymentAddrOptional,
 	))
diff --git a/contractcourt/mock_registry_test.go b/contractcourt/mock_registry_test.go
index 7acac67ec..19105a77e 100644
--- a/contractcourt/mock_registry_test.go
+++ b/contractcourt/mock_registry_test.go
@@ -1,8 +1,6 @@
 package contractcourt
 
 import (
-	"context"
-
 	"github.com/lightningnetwork/lnd/channeldb/models"
 	"github.com/lightningnetwork/lnd/invoices"
 	"github.com/lightningnetwork/lnd/lntypes"
@@ -41,8 +39,8 @@ func (r *mockRegistry) NotifyExitHopHtlc(payHash lntypes.Hash,
 
 func (r *mockRegistry) HodlUnsubscribeAll(subscriber chan<- interface{}) {}
 
-func (r *mockRegistry) LookupInvoice(context.Context, lntypes.Hash) (
-	invoices.Invoice, error) {
+func (r *mockRegistry) LookupInvoice(lntypes.Hash) (invoices.Invoice,
+	error) {
 
 	return invoices.Invoice{}, invoices.ErrInvoiceNotFound
 }
diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go
index 9c07cd53c..37e306559 100644
--- a/htlcswitch/link_test.go
+++ b/htlcswitch/link_test.go
@@ -2,7 +2,6 @@ package htlcswitch
 
 import (
 	"bytes"
-	"context"
 	"crypto/rand"
 	"crypto/sha256"
 	"encoding/binary"
@@ -484,9 +483,7 @@ func TestChannelLinkSingleHopPayment(t *testing.T) {
 
 	// Check that alice invoice was settled and bandwidth of HTLC
 	// links was changed.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State != invpkg.ContractSettled {
 		t.Fatal("alice invoice wasn't settled")
@@ -604,9 +601,7 @@ func testChannelLinkMultiHopPayment(t *testing.T,
 
 	// Check that Carol invoice was settled and bandwidth of HTLC
 	// links were changed.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State != invpkg.ContractSettled {
 		t.Fatal("carol invoice haven't been settled")
@@ -715,9 +710,7 @@ func TestChannelLinkCancelFullCommitment(t *testing.T) {
 		// invoice registry at this point, so we poll until we are able
 		// to settle.
 		err = wait.NoError(func() error {
-			return n.bobServer.registry.SettleHodlInvoice(
-				context.Background(), preimage,
-			)
+			return n.bobServer.registry.SettleHodlInvoice(preimage)
 		}, time.Minute)
 		if err != nil {
 			t.Fatal(err)
@@ -1184,9 +1177,7 @@ func TestUpdateForwardingPolicy(t *testing.T) {
 
 	// Carol's invoice should now be shown as settled as the payment
 	// succeeded.
-	invoice, err := n.carolServer.registry.LookupInvoice(
-		context.Background(), payResp,
-	)
+	invoice, err := n.carolServer.registry.LookupInvoice(payResp)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State != invpkg.ContractSettled {
 		t.Fatal("carol invoice haven't been settled")
@@ -1340,9 +1331,7 @@ func TestChannelLinkMultiHopInsufficientPayment(t *testing.T) {
 
 	// Check that alice invoice wasn't settled and bandwidth of htlc
 	// links hasn't been changed.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State == invpkg.ContractSettled {
 		t.Fatal("carol invoice have been settled")
@@ -1520,9 +1509,7 @@ func TestChannelLinkMultiHopUnknownNextHop(t *testing.T) {
 
 	// Check that alice invoice wasn't settled and bandwidth of htlc
 	// links hasn't been changed.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State == invpkg.ContractSettled {
 		t.Fatal("carol invoice have been settled")
@@ -1630,9 +1617,7 @@ func TestChannelLinkMultiHopDecodeError(t *testing.T) {
 
 	// Check that alice invoice wasn't settled and bandwidth of htlc
 	// links hasn't been changed.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State == invpkg.ContractSettled {
 		t.Fatal("carol invoice have been settled")
@@ -2421,11 +2406,10 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) {
 	)
 	require.NoError(t, err, "unable to create payment")
 
-	ctxb := context.Background()
 	// We must add the invoice to the registry, such that Alice expects
 	// this payment.
 	err = coreLink.cfg.Registry.(*mockInvoiceRegistry).AddInvoice(
-		ctxb, *invoice, htlc.PaymentHash,
+		*invoice, htlc.PaymentHash,
 	)
 	require.NoError(t, err, "unable to add invoice to registry")
 
@@ -2517,7 +2501,7 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) {
 	)
 	require.NoError(t, err, "unable to create payment")
 	err = coreLink.cfg.Registry.(*mockInvoiceRegistry).AddInvoice(
-		ctxb, *invoice, htlc.PaymentHash,
+		*invoice, htlc.PaymentHash,
 	)
 	require.NoError(t, err, "unable to add invoice to registry")
 
@@ -3641,9 +3625,7 @@ func TestChannelRetransmission(t *testing.T) {
 
 			// Check that alice invoice wasn't settled and
 			// bandwidth of htlc links hasn't been changed.
-			invoice, err = receiver.registry.LookupInvoice(
-				context.Background(), rhash,
-			)
+			invoice, err = receiver.registry.LookupInvoice(rhash)
 			if err != nil {
 				err = fmt.Errorf(
 					"unable to get invoice: %w", err,
@@ -4116,9 +4098,7 @@ func TestChannelLinkAcceptDuplicatePayment(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	err = n.carolServer.registry.AddInvoice(
-		context.Background(), *invoice, htlc.PaymentHash,
-	)
+	err = n.carolServer.registry.AddInvoice(*invoice, htlc.PaymentHash)
 	require.NoError(t, err, "unable to add invoice in carol registry")
 
 	// With the invoice now added to Carol's registry, we'll send the
@@ -4206,9 +4186,7 @@ func TestChannelLinkAcceptOverpay(t *testing.T) {
 
 	// Even though we sent 2x what was asked for, Carol should still have
 	// accepted the payment and marked it as settled.
-	invoice, err := receiver.registry.LookupInvoice(
-		context.Background(), rhash,
-	)
+	invoice, err := receiver.registry.LookupInvoice(rhash)
 	require.NoError(t, err, "unable to get invoice")
 	if invoice.State != invpkg.ContractSettled {
 		t.Fatal("carol invoice haven't been settled")
@@ -4525,7 +4503,7 @@ func generateHtlc(t *testing.T, coreLink *channelLink,
 	// We must add the invoice to the registry, such that Alice
 	// expects this payment.
 	err := coreLink.cfg.Registry.(*mockInvoiceRegistry).AddInvoice(
-		context.Background(), *invoice, htlc.PaymentHash,
+		*invoice, htlc.PaymentHash,
 	)
 	require.NoError(t, err, "unable to add invoice to registry")
 
@@ -5869,7 +5847,7 @@ func TestChannelLinkCanceledInvoice(t *testing.T) {
 
 	// Cancel the invoice at bob's end.
 	hash := invoice.Terms.PaymentPreimage.Hash()
-	err = n.bobServer.registry.CancelInvoice(context.Background(), hash)
+	err = n.bobServer.registry.CancelInvoice(hash)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -5986,9 +5964,7 @@ func TestChannelLinkHoldInvoiceSettle(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	err = ctx.n.bobServer.registry.SettleHodlInvoice(
-		context.Background(), ctx.preimage,
-	)
+	err = ctx.n.bobServer.registry.SettleHodlInvoice(ctx.preimage)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -6032,9 +6008,7 @@ func TestChannelLinkHoldInvoiceCancel(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	err = ctx.n.bobServer.registry.CancelInvoice(
-		context.Background(), ctx.hash,
-	)
+	err = ctx.n.bobServer.registry.CancelInvoice(ctx.hash)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -6088,7 +6062,7 @@ func TestChannelLinkHoldInvoiceRestart(t *testing.T) {
 	// We must add the invoice to the registry, such that Alice
 	// expects this payment.
 	err = registry.AddInvoice(
-		context.Background(), *invoice, htlc.PaymentHash,
+		*invoice, htlc.PaymentHash,
 	)
 	require.NoError(t, err, "unable to add invoice to registry")
 
@@ -6123,7 +6097,7 @@ func TestChannelLinkHoldInvoiceRestart(t *testing.T) {
 	<-registry.settleChan
 
 	// Settle the invoice with the preimage.
-	err = registry.SettleHodlInvoice(context.Background(), *preimage)
+	err = registry.SettleHodlInvoice(*preimage)
 	require.NoError(t, err, "settle hodl invoice")
 
 	// Expect alice to send a settle and commitsig message to bob.
@@ -6180,12 +6154,11 @@ func TestChannelLinkRevocationWindowRegular(t *testing.T) {
 	htlc1, invoice1 := generateHtlcAndInvoice(t, 0)
 	htlc2, invoice2 := generateHtlcAndInvoice(t, 1)
 
-	ctxb := context.Background()
 	// We must add the invoice to the registry, such that Alice
 	// expects this payment.
-	err = registry.AddInvoice(ctxb, *invoice1, htlc1.PaymentHash)
+	err = registry.AddInvoice(*invoice1, htlc1.PaymentHash)
 	require.NoError(t, err, "unable to add invoice to registry")
-	err = registry.AddInvoice(ctxb, *invoice2, htlc2.PaymentHash)
+	err = registry.AddInvoice(*invoice2, htlc2.PaymentHash)
 	require.NoError(t, err, "unable to add invoice to registry")
 
 	// Lock in htlc 1 on both sides.
@@ -6265,12 +6238,11 @@ func TestChannelLinkRevocationWindowHodl(t *testing.T) {
 	invoice2.Terms.PaymentPreimage = nil
 	invoice2.HodlInvoice = true
 
-	ctxb := context.Background()
 	// We must add the invoices to the registry, such that Alice
 	// expects the payments.
-	err = registry.AddInvoice(ctxb, *invoice1, htlc1.PaymentHash)
+	err = registry.AddInvoice(*invoice1, htlc1.PaymentHash)
 	require.NoError(t, err, "unable to add invoice to registry")
-	err = registry.AddInvoice(ctxb, *invoice2, htlc2.PaymentHash)
+	err = registry.AddInvoice(*invoice2, htlc2.PaymentHash)
 	require.NoError(t, err, "unable to add invoice to registry")
 
 	ctx := linkTestContext{
@@ -6309,7 +6281,7 @@ func TestChannelLinkRevocationWindowHodl(t *testing.T) {
 	}
 
 	// Settle invoice 1 with the preimage.
-	err = registry.SettleHodlInvoice(ctxb, *preimage1)
+	err = registry.SettleHodlInvoice(*preimage1)
 	require.NoError(t, err, "settle hodl invoice")
 
 	// Expect alice to send a settle and commitsig message to bob. Bob does
@@ -6318,7 +6290,7 @@ func TestChannelLinkRevocationWindowHodl(t *testing.T) {
 	ctx.receiveCommitSigAliceToBob(1)
 
 	// Settle invoice 2 with the preimage.
-	err = registry.SettleHodlInvoice(ctxb, *preimage2)
+	err = registry.SettleHodlInvoice(*preimage2)
 	require.NoError(t, err, "settle hodl invoice")
 
 	// Expect alice to send a settle for htlc 2.
@@ -6662,9 +6634,7 @@ func TestPipelineSettle(t *testing.T) {
 
 	// Add the invoice to Alice's registry so she expects it.
 	aliceReg := alice.coreLink.cfg.Registry.(*mockInvoiceRegistry)
-	err = aliceReg.AddInvoice(
-		context.Background(), *invoice1, htlc1.PaymentHash,
-	)
+	err = aliceReg.AddInvoice(*invoice1, htlc1.PaymentHash)
 	require.NoError(t, err)
 
 	// <---add-----
diff --git a/htlcswitch/switch_test.go b/htlcswitch/switch_test.go
index 2d507f01b..28f3d9e2c 100644
--- a/htlcswitch/switch_test.go
+++ b/htlcswitch/switch_test.go
@@ -1,7 +1,6 @@
 package htlcswitch
 
 import (
-	"context"
 	"crypto/rand"
 	"crypto/sha256"
 	"fmt"
@@ -3565,9 +3564,7 @@ func (n *threeHopNetwork) sendThreeHopPayment(t *testing.T) (*lnwire.UpdateAddHT
 		t.Fatal(err)
 	}
 
-	err = n.carolServer.registry.AddInvoice(
-		context.Background(), *invoice, htlc.PaymentHash,
-	)
+	err = n.carolServer.registry.AddInvoice(*invoice, htlc.PaymentHash)
 	require.NoError(t, err, "unable to add invoice in carol registry")
 
 	if err := n.aliceServer.htlcSwitch.SendHTLC(
diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go
index da36e214c..649570d2c 100644
--- a/htlcswitch/test_utils.go
+++ b/htlcswitch/test_utils.go
@@ -2,7 +2,6 @@ package htlcswitch
 
 import (
 	"bytes"
-	"context"
 	crand "crypto/rand"
 	"crypto/sha256"
 	"encoding/binary"
@@ -781,9 +780,7 @@ func preparePayment(sendingPeer, receivingPeer lnpeer.Peer,
 
 	// Check who is last in the route and add invoice to server registry.
 	hash := invoice.Terms.PaymentPreimage.Hash()
-	if err := receiver.registry.AddInvoice(
-		context.Background(), *invoice, hash,
-	); err != nil {
+	if err := receiver.registry.AddInvoice(*invoice, hash); err != nil {
 		return nil, nil, err
 	}
 
@@ -1341,9 +1338,7 @@ func (n *twoHopNetwork) makeHoldPayment(sendingPeer, receivingPeer lnpeer.Peer,
 	}
 
 	// Check who is last in the route and add invoice to server registry.
-	if err := receiver.registry.AddInvoice(
-		context.Background(), *invoice, rhash,
-	); err != nil {
+	if err := receiver.registry.AddInvoice(*invoice, rhash); err != nil {
 		paymentErr <- err
 		return paymentErr
 	}
diff --git a/invoices/invoiceregistry_test.go b/invoices/invoiceregistry_test.go
index f91777f3d..1b93b8f24 100644
--- a/invoices/invoiceregistry_test.go
+++ b/invoices/invoiceregistry_test.go
@@ -1,7 +1,6 @@
 package invoices_test
 
 import (
-	"context"
 	"crypto/rand"
 	"math"
 	"testing"
@@ -24,14 +23,13 @@ func TestSettleInvoice(t *testing.T) {
 
 	ctx := newTestContext(t, nil)
 
-	ctxb := context.Background()
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
 	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	// Subscribe to the not yet existing invoice.
 	subscription, err := ctx.registry.SubscribeSingleInvoice(
-		ctxb, testInvoicePaymentHash,
+		testInvoicePaymentHash,
 	)
 	if err != nil {
 		t.Fatal(err)
@@ -43,7 +41,7 @@ func TestSettleInvoice(t *testing.T) {
 	// Add the invoice.
 	testInvoice := newInvoice(t, false)
 	addIdx, err := ctx.registry.AddInvoice(
-		ctxb, testInvoice, testInvoicePaymentHash,
+		testInvoice, testInvoicePaymentHash,
 	)
 	if err != nil {
 		t.Fatal(err)
@@ -176,7 +174,7 @@ func TestSettleInvoice(t *testing.T) {
 
 	// Check that settled amount is equal to the sum of values of the htlcs
 	// 0 and 1.
-	inv, err := ctx.registry.LookupInvoice(ctxb, testInvoicePaymentHash)
+	inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -186,7 +184,7 @@ func TestSettleInvoice(t *testing.T) {
 	}
 
 	// Try to cancel.
-	err = ctx.registry.CancelInvoice(ctxb, testInvoicePaymentHash)
+	err = ctx.registry.CancelInvoice(testInvoicePaymentHash)
 	require.ErrorIs(t, err, invpkg.ErrInvoiceAlreadySettled)
 
 	// As this is a direct settle, we expect nothing on the hodl chan.
@@ -207,30 +205,31 @@ func testCancelInvoice(t *testing.T, gc bool) {
 	cfg.GcCanceledInvoicesOnTheFly = gc
 	ctx := newTestContext(t, &cfg)
 
-	ctxb := context.Background()
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
 	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	// Try to cancel the not yet existing invoice. This should fail.
-	err = ctx.registry.CancelInvoice(ctxb, testInvoicePaymentHash)
+	err = ctx.registry.CancelInvoice(testInvoicePaymentHash)
 	require.ErrorIs(t, err, invpkg.ErrInvoiceNotFound)
 
 	// Subscribe to the not yet existing invoice.
 	subscription, err := ctx.registry.SubscribeSingleInvoice(
-		ctxb, testInvoicePaymentHash,
+		testInvoicePaymentHash,
 	)
-	require.NoError(t, err)
+	if err != nil {
+		t.Fatal(err)
+	}
 	defer subscription.Cancel()
 
 	require.Equal(t, subscription.PayHash(), &testInvoicePaymentHash)
 
 	// Add the invoice.
 	testInvoice := newInvoice(t, false)
-	_, err = ctx.registry.AddInvoice(
-		ctxb, testInvoice, testInvoicePaymentHash,
-	)
-	require.NoError(t, err)
+	_, err = ctx.registry.AddInvoice(testInvoice, testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// We expect the open state to be sent to the single invoice subscriber.
 	select {
@@ -259,8 +258,10 @@ func testCancelInvoice(t *testing.T, gc bool) {
 	}
 
 	// Cancel invoice.
-	err = ctx.registry.CancelInvoice(ctxb, testInvoicePaymentHash)
-	require.NoError(t, err)
+	err = ctx.registry.CancelInvoice(testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// We expect the canceled state to be sent to the single invoice
 	// subscriber.
@@ -279,7 +280,7 @@ func testCancelInvoice(t *testing.T, gc bool) {
 	if gc {
 		// Check that the invoice has been deleted from the db.
 		_, err = ctx.idb.LookupInvoice(
-			ctxb, invpkg.InvoiceRefByHash(testInvoicePaymentHash),
+			invpkg.InvoiceRefByHash(testInvoicePaymentHash),
 		)
 		require.Error(t, err)
 	}
@@ -290,7 +291,7 @@ func testCancelInvoice(t *testing.T, gc bool) {
 	// Try to cancel again. Expect that we report ErrInvoiceNotFound if the
 	// invoice has been garbage collected (since the invoice has been
 	// deleted when it was canceled), and no error otherwise.
-	err = ctx.registry.CancelInvoice(ctxb, testInvoicePaymentHash)
+	err = ctx.registry.CancelInvoice(testInvoicePaymentHash)
 
 	if gc {
 		require.Error(t, err, invpkg.ErrInvoiceNotFound)
@@ -365,27 +366,32 @@ func TestSettleHoldInvoice(t *testing.T) {
 	registry := invpkg.NewRegistry(idb, expiryWatcher, &cfg)
 
 	err = registry.Start()
-	require.NoError(t, err)
+	if err != nil {
+		t.Fatal(err)
+	}
 	defer registry.Stop()
 
-	ctxb := context.Background()
-	allSubscriptions, err := registry.SubscribeNotifications(ctxb, 0, 0)
+	allSubscriptions, err := registry.SubscribeNotifications(0, 0)
 	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	// Subscribe to the not yet existing invoice.
 	subscription, err := registry.SubscribeSingleInvoice(
-		ctxb, testInvoicePaymentHash,
+		testInvoicePaymentHash,
 	)
-	require.NoError(t, err)
+	if err != nil {
+		t.Fatal(err)
+	}
 	defer subscription.Cancel()
 
 	require.Equal(t, subscription.PayHash(), &testInvoicePaymentHash)
 
 	// Add the invoice.
 	invoice := newInvoice(t, true)
-	_, err = registry.AddInvoice(ctxb, invoice, testInvoicePaymentHash)
-	require.NoError(t, err)
+	_, err = registry.AddInvoice(invoice, testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	// We expect the open state to be sent to the single invoice subscriber.
 	update := <-subscription.Updates
@@ -469,8 +475,10 @@ func TestSettleHoldInvoice(t *testing.T) {
 	}
 
 	// Settling with preimage should succeed.
-	err = registry.SettleHodlInvoice(ctxb, testInvoicePreimage)
-	require.NoError(t, err, "expected set preimage to succeed")
+	err = registry.SettleHodlInvoice(testInvoicePreimage)
+	if err != nil {
+		t.Fatal("expected set preimage to succeed")
+	}
 
 	htlcResolution, _ := (<-hodlChan).(invpkg.HtlcResolution)
 	require.NotNil(t, htlcResolution)
@@ -499,14 +507,14 @@ func TestSettleHoldInvoice(t *testing.T) {
 	}
 
 	// Idempotency.
-	err = registry.SettleHodlInvoice(ctxb, testInvoicePreimage)
+	err = registry.SettleHodlInvoice(testInvoicePreimage)
 	require.ErrorIs(t, err, invpkg.ErrInvoiceAlreadySettled)
 
 	// Try to cancel.
-	err = registry.CancelInvoice(ctxb, testInvoicePaymentHash)
-	require.Error(
-		t, err, "expected cancellation of a settled invoice to fail",
-	)
+	err = registry.CancelInvoice(testInvoicePaymentHash)
+	if err == nil {
+		t.Fatal("expected cancellation of a settled invoice to fail")
+	}
 }
 
 // TestCancelHoldInvoice tests canceling of a hold invoice and related
@@ -537,12 +545,12 @@ func TestCancelHoldInvoice(t *testing.T) {
 		require.NoError(t, registry.Stop())
 	})
 
-	ctxb := context.Background()
-
 	// Add the invoice.
 	invoice := newInvoice(t, true)
-	_, err = registry.AddInvoice(ctxb, invoice, testInvoicePaymentHash)
-	require.NoError(t, err)
+	_, err = registry.AddInvoice(invoice, testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	amtPaid := lnwire.MilliSatoshi(100000)
 	hodlChan := make(chan interface{}, 1)
@@ -561,8 +569,10 @@ func TestCancelHoldInvoice(t *testing.T) {
 	}
 
 	// Cancel invoice.
-	err = registry.CancelInvoice(ctxb, testInvoicePaymentHash)
-	require.NoError(t, err, "cancel invoice failed")
+	err = registry.CancelInvoice(testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal("cancel invoice failed")
+	}
 
 	htlcResolution, _ := (<-hodlChan).(invpkg.HtlcResolution)
 	require.NotNil(t, htlcResolution)
@@ -632,10 +642,8 @@ func testKeySend(t *testing.T, keySendEnabled bool) {
 	cfg.AcceptKeySend = keySendEnabled
 	ctx := newTestContext(t, &cfg)
 
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(
-		context.Background(), 0, 0,
-	)
-	require.NoError(t, err)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
+	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	hodlChan := make(chan interface{}, 1)
@@ -764,9 +772,8 @@ func testHoldKeysend(t *testing.T, timeoutKeysend bool) {
 	cfg.KeysendHoldTime = holdDuration
 	ctx := newTestContext(t, &cfg)
 
-	ctxb := context.Background()
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
-	require.NoError(t, err)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
+	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	hodlChan := make(chan interface{}, 1)
@@ -833,8 +840,8 @@ func testHoldKeysend(t *testing.T, timeoutKeysend bool) {
 	}
 
 	// Settle keysend payment manually.
-	require.NoError(t, ctx.registry.SettleHodlInvoice(
-		ctxb, *newInvoice.Terms.PaymentPreimage,
+	require.Nil(t, ctx.registry.SettleHodlInvoice(
+		*newInvoice.Terms.PaymentPreimage,
 	))
 
 	// We expect a settled notification to be sent out.
@@ -850,14 +857,13 @@ func TestMppPayment(t *testing.T) {
 	defer timeout()()
 
 	ctx := newTestContext(t, nil)
-	ctxb := context.Background()
 
 	// Add the invoice.
 	testInvoice := newInvoice(t, false)
-	_, err := ctx.registry.AddInvoice(
-		ctxb, testInvoice, testInvoicePaymentHash,
-	)
-	require.NoError(t, err)
+	_, err := ctx.registry.AddInvoice(testInvoice, testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 
 	mppPayload := &mockPayload{
 		mpp: record.NewMPP(testInvoiceAmount, [32]byte{}),
@@ -927,8 +933,10 @@ func TestMppPayment(t *testing.T) {
 
 	// Check that settled amount is equal to the sum of values of the htlcs
 	// 2 and 3.
-	inv, err := ctx.registry.LookupInvoice(ctxb, testInvoicePaymentHash)
-	require.NoError(t, err)
+	inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
+	if err != nil {
+		t.Fatal(err)
+	}
 	if inv.State != invpkg.ContractSettled {
 		t.Fatal("expected invoice to be settled")
 	}
@@ -944,16 +952,17 @@ func TestMppPayment(t *testing.T) {
 func TestMppPaymentWithOverpayment(t *testing.T) {
 	t.Parallel()
 
-	ctxb := context.Background()
 	f := func(overpaymentRand uint64) bool {
 		ctx := newTestContext(t, nil)
 
 		// Add the invoice.
 		testInvoice := newInvoice(t, false)
 		_, err := ctx.registry.AddInvoice(
-			ctxb, testInvoice, testInvoicePaymentHash,
+			testInvoice, testInvoicePaymentHash,
 		)
-		require.NoError(t, err)
+		if err != nil {
+			t.Fatal(err)
+		}
 
 		mppPayload := &mockPayload{
 			mpp: record.NewMPP(testInvoiceAmount, [32]byte{}),
@@ -1000,10 +1009,10 @@ func TestMppPaymentWithOverpayment(t *testing.T) {
 
 		// Check that settled amount is equal to the sum of values of
 		// the htlcs 1 and 2.
-		inv, err := ctx.registry.LookupInvoice(
-			ctxb, testInvoicePaymentHash,
-		)
-		require.NoError(t, err)
+		inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
+		if err != nil {
+			t.Fatal(err)
+		}
 		if inv.State != invpkg.ContractSettled {
 			t.Fatal("expected invoice to be settled")
 		}
@@ -1041,12 +1050,10 @@ func TestInvoiceExpiryWithRegistry(t *testing.T) {
 		t, testTime, 0, numExpired, numPending,
 	)
 
-	ctxb := context.Background()
-
 	var expectedCancellations []lntypes.Hash
 	expiredInvoices := existingInvoices.expiredInvoices
 	for paymentHash, expiredInvoice := range expiredInvoices {
-		_, err := idb.AddInvoice(ctxb, expiredInvoice, paymentHash)
+		_, err := idb.AddInvoice(expiredInvoice, paymentHash)
 		require.NoError(t, err)
 		expectedCancellations = append(
 			expectedCancellations, paymentHash,
@@ -1055,7 +1062,7 @@ func TestInvoiceExpiryWithRegistry(t *testing.T) {
 
 	pendingInvoices := existingInvoices.pendingInvoices
 	for paymentHash, pendingInvoice := range pendingInvoices {
-		_, err := idb.AddInvoice(ctxb, pendingInvoice, paymentHash)
+		_, err := idb.AddInvoice(pendingInvoice, paymentHash)
 		require.NoError(t, err)
 	}
 
@@ -1071,20 +1078,24 @@ func TestInvoiceExpiryWithRegistry(t *testing.T) {
 
 	var invoicesThatWillCancel []lntypes.Hash
 	for paymentHash, pendingInvoice := range newInvoices.pendingInvoices {
-		_, err := registry.AddInvoice(ctxb, pendingInvoice, paymentHash)
-		require.NoError(t, err)
+		_, err := registry.AddInvoice(pendingInvoice, paymentHash)
 		invoicesThatWillCancel = append(
 			invoicesThatWillCancel, paymentHash,
 		)
+		if err != nil {
+			t.Fatal(err)
+		}
 	}
 
 	// Check that they are really not canceled until before the clock is
 	// advanced.
 	for i := range invoicesThatWillCancel {
 		invoice, err := registry.LookupInvoice(
-			ctxb, invoicesThatWillCancel[i],
+			invoicesThatWillCancel[i],
 		)
-		require.NoError(t, err, "cannot find invoice")
+		if err != nil {
+			t.Fatalf("cannot find invoice: %v", err)
+		}
 
 		if invoice.State == invpkg.ContractCanceled {
 			t.Fatalf("expected pending invoice, got canceled")
@@ -1104,7 +1115,7 @@ func TestInvoiceExpiryWithRegistry(t *testing.T) {
 	canceled := func() bool {
 		for i := range expectedCancellations {
 			invoice, err := registry.LookupInvoice(
-				ctxb, expectedCancellations[i],
+				expectedCancellations[i],
 			)
 			require.NoError(t, err)
 
@@ -1151,8 +1162,6 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) {
 		t, testTime, 0, numExpired, numPending,
 	)
 
-	ctxb := context.Background()
-
 	i := 0
 	for paymentHash, invoice := range existingInvoices.expiredInvoices {
 		// Mark half of the invoices as settled, the other half as
@@ -1163,7 +1172,7 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) {
 			invoice.State = invpkg.ContractCanceled
 		}
 
-		_, err := idb.AddInvoice(ctxb, invoice, paymentHash)
+		_, err := idb.AddInvoice(invoice, paymentHash)
 		require.NoError(t, err)
 		i++
 	}
@@ -1177,7 +1186,7 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) {
 		NumMaxInvoices: math.MaxUint64,
 	}
 
-	response, err := idb.QueryInvoices(ctxb, query)
+	response, err := idb.QueryInvoices(query)
 	require.NoError(t, err)
 
 	// Save all settled invoices for our expectation set.
@@ -1193,7 +1202,7 @@ func TestOldInvoiceRemovalOnStart(t *testing.T) {
 	require.NoError(t, err, "cannot start the registry")
 
 	// Perform a scan query to collect all invoices.
-	response, err = idb.QueryInvoices(ctxb, query)
+	response, err = idb.QueryInvoices(query)
 	require.NoError(t, err)
 
 	// Check that we really only kept the settled invoices after the
@@ -1239,10 +1248,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) {
 	testInvoice.HodlInvoice = true
 	testInvoice.PaymentRequest = []byte{1, 2, 3}
 
-	ctxb := context.Background()
-	_, err := ctx.registry.AddInvoice(
-		ctxb, testInvoice, testInvoicePaymentHash,
-	)
+	_, err := ctx.registry.AddInvoice(testInvoice, testInvoicePaymentHash)
 	require.NoError(t, err)
 
 	payLoad := testPayload
@@ -1269,9 +1275,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) {
 	}
 
 	require.Eventually(t, func() bool {
-		inv, err := ctx.registry.LookupInvoice(
-			ctxb, testInvoicePaymentHash,
-		)
+		inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
 		require.NoError(t, err)
 
 		return inv.State == invpkg.ContractAccepted
@@ -1295,7 +1299,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) {
 
 	// If we want to settle our invoice in this test, we do so now.
 	if settle {
-		err = ctx.registry.SettleHodlInvoice(ctxb, testInvoicePreimage)
+		err = ctx.registry.SettleHodlInvoice(testInvoicePreimage)
 		require.NoError(t, err)
 
 		for i := 0; i < numParts; i++ {
@@ -1329,7 +1333,7 @@ func testHeightExpiryWithRegistry(t *testing.T, numParts int, settle bool) {
 
 	// Finally, lookup the invoice and assert that we have the state we
 	// expect.
-	inv, err := ctx.registry.LookupInvoice(ctxb, testInvoicePaymentHash)
+	inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
 	require.NoError(t, err)
 	require.Equal(t, expectedState, inv.State, "expected "+
 		"hold invoice: %v, got: %v", expectedState, inv.State)
@@ -1348,10 +1352,7 @@ func TestMultipleSetHeightExpiry(t *testing.T) {
 	// Add a hold invoice.
 	testInvoice := newInvoice(t, true)
 
-	ctxb := context.Background()
-	_, err := ctx.registry.AddInvoice(
-		ctxb, testInvoice, testInvoicePaymentHash,
-	)
+	_, err := ctx.registry.AddInvoice(testInvoice, testInvoicePaymentHash)
 	require.NoError(t, err)
 
 	mppPayload := &mockPayload{
@@ -1408,7 +1409,7 @@ func TestMultipleSetHeightExpiry(t *testing.T) {
 
 	// Assert that we've reached an accepted state because the invoice has
 	// been paid with a complete set.
-	inv, err := ctx.registry.LookupInvoice(ctxb, testInvoicePaymentHash)
+	inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
 	require.NoError(t, err)
 	require.Equal(t, invpkg.ContractAccepted, inv.State, "expected "+
 		"hold invoice accepted")
@@ -1420,9 +1421,7 @@ func TestMultipleSetHeightExpiry(t *testing.T) {
 	}
 
 	require.Eventuallyf(t, func() bool {
-		inv, err := ctx.registry.LookupInvoice(
-			ctxb, testInvoicePaymentHash,
-		)
+		inv, err := ctx.registry.LookupInvoice(testInvoicePaymentHash)
 		require.NoError(t, err)
 
 		return inv.State == invpkg.ContractCanceled
@@ -1436,15 +1435,14 @@ func TestSettleInvoicePaymentAddrRequired(t *testing.T) {
 	t.Parallel()
 
 	ctx := newTestContext(t, nil)
-	ctxb := context.Background()
 
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
-	require.NoError(t, err)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
+	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	// Subscribe to the not yet existing invoice.
 	subscription, err := ctx.registry.SubscribeSingleInvoice(
-		ctxb, testInvoicePaymentHash,
+		testInvoicePaymentHash,
 	)
 	require.NoError(t, err)
 	defer subscription.Cancel()
@@ -1469,7 +1467,7 @@ func TestSettleInvoicePaymentAddrRequired(t *testing.T) {
 	// Add the invoice, which requires the MPP payload to always be
 	// included due to its set of feature bits.
 	addIdx, err := ctx.registry.AddInvoice(
-		ctxb, invoice, testInvoicePaymentHash,
+		invoice, testInvoicePaymentHash,
 	)
 	require.NoError(t, err)
 	require.Equal(t, int(addIdx), 1)
@@ -1525,15 +1523,14 @@ func TestSettleInvoicePaymentAddrRequiredOptionalGrace(t *testing.T) {
 	t.Parallel()
 
 	ctx := newTestContext(t, nil)
-	ctxb := context.Background()
 
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
-	require.NoError(t, err)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
+	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
 	// Subscribe to the not yet existing invoice.
 	subscription, err := ctx.registry.SubscribeSingleInvoice(
-		ctxb, testInvoicePaymentHash,
+		testInvoicePaymentHash,
 	)
 	require.NoError(t, err)
 	defer subscription.Cancel()
@@ -1559,7 +1556,7 @@ func TestSettleInvoicePaymentAddrRequiredOptionalGrace(t *testing.T) {
 	// Add the invoice, which does not require the MPP payload to always be
 	// included due to its set of feature bits.
 	addIdx, err := ctx.registry.AddInvoice(
-		ctxb, invoice, testInvoicePaymentHash,
+		invoice, testInvoicePaymentHash,
 	)
 	require.NoError(t, err)
 	require.Equal(t, int(addIdx), 1)
@@ -1728,9 +1725,8 @@ func testSpontaneousAmpPayment(
 	cfg := defaultRegistryConfig()
 	cfg.AcceptAMP = ampEnabled
 	ctx := newTestContext(t, &cfg)
-	ctxb := context.Background()
 
-	allSubscriptions, err := ctx.registry.SubscribeNotifications(ctxb, 0, 0)
+	allSubscriptions, err := ctx.registry.SubscribeNotifications(0, 0)
 	require.Nil(t, err)
 	defer allSubscriptions.Cancel()
 
diff --git a/itest/lnd_channel_backup_test.go b/itest/lnd_channel_backup_test.go
index e4c046b3d..f73b2f22b 100644
--- a/itest/lnd_channel_backup_test.go
+++ b/itest/lnd_channel_backup_test.go
@@ -783,15 +783,16 @@ func runChanRestoreScenarioForceClose(ht *lntest.HarnessTest, zeroConf bool) {
 		ht, crs.password, crs.mnemonic, multi, dave,
 	)
 
-	// We now wait until both Dave's closing tx.
-	ht.Miner.AssertNumTxsInMempool(1)
+	// We now wait until both Dave's closing tx and sweep tx have shown in
+	// mempool.
+	ht.Miner.AssertNumTxsInMempool(2)
 
 	// Now that we're able to make our restored now, we'll shutdown the old
 	// Dave node as we'll be storing it shortly below.
 	ht.Shutdown(dave)
 
 	// Mine a block to confirm the closing tx from Dave.
-	ht.MineBlocksAndAssertNumTxes(1, 1)
+	ht.MineBlocksAndAssertNumTxes(1, 2)
 
 	// To make sure the channel state is advanced correctly if the channel
 	// peer is not online at first, we also shutdown Carol.
@@ -1411,9 +1412,8 @@ func chanRestoreViaRPC(ht *lntest.HarnessTest, password []byte,
 func assertTimeLockSwept(ht *lntest.HarnessTest, carol, dave *node.HarnessNode,
 	carolStartingBalance, daveStartingBalance int64) {
 
-	// We expect Carol to sweep her funds and also the anchor tx. In
-	// addition, Dave will also sweep his anchor output.
-	expectedTxes := 3
+	// We expect Carol to sweep her funds and also the anchor tx.
+	expectedTxes := 2
 
 	// Carol should sweep her funds immediately, as they are not
 	// timelocked.
@@ -1495,7 +1495,11 @@ func assertDLPExecuted(ht *lntest.HarnessTest,
 
 	// Upon reconnection, the nodes should detect that Dave is out of sync.
 	// Carol should force close the channel using her latest commitment.
-	ht.Miner.AssertNumTxsInMempool(1)
+	expectedTxes := 1
+	if lntest.CommitTypeHasAnchors(commitType) {
+		expectedTxes = 2
+	}
+	ht.Miner.AssertNumTxsInMempool(expectedTxes)
 
 	// Channel should be in the state "waiting close" for Carol since she
 	// broadcasted the force close tx.
@@ -1511,8 +1515,7 @@ func assertDLPExecuted(ht *lntest.HarnessTest,
 	ht.RestartNode(dave)
 
 	// Generate a single block, which should confirm the closing tx.
-	ht.MineBlocksAndAssertNumTxes(1, 1)
-	blocksMined := uint32(1)
+	ht.MineBlocksAndAssertNumTxes(1, expectedTxes)
 
 	// Dave should consider the channel pending force close (since he is
 	// waiting for his sweep to confirm).
@@ -1529,14 +1532,6 @@ func assertDLPExecuted(ht *lntest.HarnessTest,
 
 		// Mine Dave's anchor sweep tx.
 		ht.MineBlocksAndAssertNumTxes(1, 1)
-		blocksMined++
-
-		// The above block will trigger Carol's sweeper to reconsider
-		// the anchor sweeping. Because we are now sweeping at the fee
-		// rate floor, the sweeper will consider this input has
-		// positive yield thus attempts the sweeping.
-		ht.MineBlocksAndAssertNumTxes(1, 1)
-		blocksMined++
 
 		// After Carol's output matures, she should also reclaim her
 		// funds.
@@ -1544,7 +1539,7 @@ func assertDLPExecuted(ht *lntest.HarnessTest,
 		// The commit sweep resolver publishes the sweep tx at
 		// defaultCSV-1 and we already mined one block after the
 		// commitmment was published, so take that into account.
-		ht.MineBlocks(defaultCSV - blocksMined)
+		ht.MineBlocks(defaultCSV - 1 - 1)
 		ht.MineBlocksAndAssertNumTxes(1, 1)
 
 		// Now the channel should be fully closed also from Carol's POV.
@@ -1566,33 +1561,21 @@ func assertDLPExecuted(ht *lntest.HarnessTest,
 		// Dave should sweep his funds immediately, as they are not
 		// timelocked. We also expect Dave to sweep his anchor, if
 		// present.
-		if lntest.CommitTypeHasAnchors(commitType) {
-			ht.MineBlocksAndAssertNumTxes(1, 2)
-		} else {
-			ht.MineBlocksAndAssertNumTxes(1, 1)
-		}
+		ht.Miner.AssertNumTxsInMempool(expectedTxes)
 
-		blocksMined++
+		// Mine the sweep tx.
+		ht.MineBlocksAndAssertNumTxes(1, expectedTxes)
 
 		// Now Dave should consider the channel fully closed.
 		ht.AssertNumPendingForceClose(dave, 0)
 
-		// The above block will trigger Carol's sweeper to reconsider
-		// the anchor sweeping. Because we are now sweeping at the fee
-		// rate floor, the sweeper will consider this input has
-		// positive yield thus attempts the sweeping.
-		if lntest.CommitTypeHasAnchors(commitType) {
-			ht.MineBlocksAndAssertNumTxes(1, 1)
-			blocksMined++
-		}
-
 		// After Carol's output matures, she should also reclaim her
 		// funds.
 		//
 		// The commit sweep resolver publishes the sweep tx at
-		// defaultCSV-1 and we already have blocks mined after the
+		// defaultCSV-1 and we already mined one block after the
 		// commitmment was published, so take that into account.
-		ht.MineBlocks(defaultCSV - blocksMined)
+		ht.MineBlocks(defaultCSV - 1 - 1)
 		ht.MineBlocksAndAssertNumTxes(1, 1)
 
 		// Now the channel should be fully closed also from Carol's
diff --git a/itest/lnd_channel_force_close_test.go b/itest/lnd_channel_force_close_test.go
index e640ea583..1bb2ff080 100644
--- a/itest/lnd_channel_force_close_test.go
+++ b/itest/lnd_channel_force_close_test.go
@@ -23,13 +23,10 @@ import (
 )
 
 // testCommitmentTransactionDeadline tests that the anchor sweep transaction is
-// taking account of the deadline of the commitment transaction. It tests three
+// taking account of the deadline of the commitment transaction. It tests two
 // scenarios:
 //  1. when the CPFP is skipped, checks that the deadline is not used.
-//  2. when the CPFP is used, checks that the deadline is NOT applied when it's
-//     larger than 144.
-//  3. when the CPFP is used, checks that the deadline is applied when it's
-//     less than 144.
+//  2. when the CPFP is used, checks that the deadline is applied.
 //
 // Note that whether the deadline is used or not is implicitly checked by its
 // corresponding fee rates.
@@ -46,13 +43,13 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 		// DefaultAnchorsCommitMaxFeeRateSatPerVByte.
 		feeRateDefault = 20000
 
-		// defaultDeadline is the anchorSweepConfTarget, which is used
-		// when the commitment has no deadline pressure.
-		defaultDeadline = 144
+		// finalCTLV is used when Alice sends payment to Bob.
+		finalCTLV = 144
 
-		// deadline is one block below the default deadline. A forced
-		// anchor sweep will be performed when seeing this value.
-		deadline = defaultDeadline - 1
+		// deadline is used when Alice sweep the anchor. Notice there
+		// is a block padding of 3 added, such that the value of
+		// deadline is 147.
+		deadline = uint32(finalCTLV + routing.BlockPadding)
 	)
 
 	// feeRateSmall(sat/kw) is used when we want to skip the CPFP
@@ -94,7 +91,7 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 
 	// calculateSweepFeeRate runs multiple steps to calculate the fee rate
 	// used in sweeping the transactions.
-	calculateSweepFeeRate := func(expectedSweepTxNum, deadline int) int64 {
+	calculateSweepFeeRate := func(expectedSweepTxNum int) int64 {
 		// Create two nodes, Alice and Bob.
 		alice := setupNode("Alice")
 		defer ht.Shutdown(alice)
@@ -113,10 +110,6 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 			},
 		)
 
-		// Calculate the final ctlv delta based on the expected
-		// deadline.
-		finalCltvDelta := int32(deadline - int(routing.BlockPadding))
-
 		// Send a payment with a specified finalCTLVDelta, which will
 		// be used as our deadline later on when Alice force closes the
 		// channel.
@@ -124,7 +117,7 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 			Dest:           bob.PubKey[:],
 			Amt:            10e4,
 			PaymentHash:    ht.Random32Bytes(),
-			FinalCltvDelta: finalCltvDelta,
+			FinalCltvDelta: finalCTLV,
 			TimeoutSeconds: 60,
 			FeeLimitMsat:   noFeeLimitMsat,
 		}
@@ -161,27 +154,8 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 	// we should see only one sweep tx in the mempool.
 	ht.SetFeeEstimateWithConf(feeRateSmall, deadline)
 
-	// Calculate fee rate used and assert only the force close tx is
-	// broadcast.
-	feeRate := calculateSweepFeeRate(1, deadline)
-
-	// We expect the default max fee rate is used. Allow some deviation
-	// because weight estimates during tx generation are estimates.
-	require.InEpsilonf(
-		ht, int64(maxPerKw), feeRate, 0.01,
-		"expected fee rate:%d, got fee rate:%d", maxPerKw, feeRate,
-	)
-
-	// Setup our fee estimation for the deadline. Because the fee rate is
-	// greater than the parent tx's fee rate, this value will be used to
-	// sweep the anchor transaction. However, due to the default value
-	// being used, we should not attempt CPFP here because we are not force
-	// sweeping the anchor output.
-	ht.SetFeeEstimateWithConf(feeRateLarge, defaultDeadline)
-
-	// Calculate fee rate used and assert only the force close tx is
-	// broadcast.
-	feeRate = calculateSweepFeeRate(1, defaultDeadline)
+	// Calculate fee rate used.
+	feeRate := calculateSweepFeeRate(1)
 
 	// We expect the default max fee rate is used. Allow some deviation
 	// because weight estimates during tx generation are estimates.
@@ -196,9 +170,8 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) {
 	// transactions in the mempool.
 	ht.SetFeeEstimateWithConf(feeRateLarge, deadline)
 
-	// Calculate fee rate used and assert both the force close tx and the
-	// anchor sweeping tx are broadcast.
-	feeRate = calculateSweepFeeRate(2, deadline)
+	// Calculate fee rate used.
+	feeRate = calculateSweepFeeRate(2)
 
 	// We expect the anchor to be swept with the deadline, which has the
 	// fee rate of feeRateLarge.
diff --git a/itest/lnd_multi-hop_test.go b/itest/lnd_multi-hop_test.go
index 2630bbde6..129fde910 100644
--- a/itest/lnd_multi-hop_test.go
+++ b/itest/lnd_multi-hop_test.go
@@ -784,21 +784,20 @@ func runMultiHopRemoteForceCloseOnChainHtlcTimeout(ht *lntest.HarnessTest,
 	ht.AssertActiveHtlcs(bob, payHash[:])
 	ht.AssertActiveHtlcs(carol, payHash[:])
 
+	// Increase the fee estimate so that the following force close tx will
+	// be cpfp'ed.
+	ht.SetFeeEstimate(30000)
+
 	// At this point, we'll now instruct Carol to force close the
 	// transaction. This will let us exercise that Bob is able to sweep the
-	// expired HTLC on Carol's version of the commitment transaction.
+	// expired HTLC on Carol's version of the commitment transaction. If
+	// Carol has an anchor, it will be swept too.
+	hasAnchors := lntest.CommitTypeHasAnchors(c)
 	closeStream, _ := ht.CloseChannelAssertPending(
 		carol, bobChanPoint, true,
 	)
-
-	// For anchor channels, the anchor won't be used for CPFP because
-	// channel arbitrator thinks Carol doesn't have preimage for her
-	// incoming HTLC on the commitment transaction Bob->Carol. Although
-	// Carol created this invoice, because it's a hold invoice, the
-	// preimage won't be generated automatically.
-	hasAnchorSweep := false
 	closeTx := ht.AssertStreamChannelForceClosed(
-		carol, bobChanPoint, hasAnchorSweep, closeStream,
+		carol, bobChanPoint, hasAnchors, closeStream,
 	)
 
 	// Increase the blocks mined. At this step
@@ -829,18 +828,7 @@ func runMultiHopRemoteForceCloseOnChainHtlcTimeout(ht *lntest.HarnessTest,
 		ht.Fatalf("unhandled commitment type %v", c)
 	}
 
-	// We now mine a block to clear up the mempool.
-	ht.MineBlocksAndAssertNumTxes(1, expectedTxes)
-	blocksMined++
-
-	// The above block will trigger Carol's sweeper to reconsider the
-	// anchor sweeping. Because we are now sweeping at the fee rate floor,
-	// the sweeper will consider this input has positive yield thus
-	// attempts the sweeping.
-	if lntest.CommitTypeHasAnchors(c) {
-		ht.MineBlocksAndAssertNumTxes(1, 1)
-		blocksMined++
-	}
+	ht.Miner.AssertNumTxsInMempool(expectedTxes)
 
 	// Next, we'll mine enough blocks for the HTLC to expire. At this
 	// point, Bob should hand off the output to his internal utxo nursery,
@@ -974,20 +962,18 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 	// to be mined to trigger a force close later on.
 	var blocksMined uint32
 
+	// Increase the fee estimate so that the following force close tx will
+	// be cpfp'ed.
+	ht.SetFeeEstimate(30000)
+
 	// At this point, Bob decides that he wants to exit the channel
 	// immediately, so he force closes his commitment transaction.
+	hasAnchors := lntest.CommitTypeHasAnchors(c)
 	closeStream, _ := ht.CloseChannelAssertPending(
 		bob, aliceChanPoint, true,
 	)
-
-	// For anchor channels, the anchor won't be used for CPFP as there's no
-	// deadline pressure for Bob on the channel Alice->Bob at the moment.
-	// For Bob's local commitment tx, there's only one incoming HTLC which
-	// he doesn't have the preimage yet. Thus this anchor won't be
-	// force-swept.
-	hasAnchorSweep := false
 	bobForceClose := ht.AssertStreamChannelForceClosed(
-		bob, aliceChanPoint, hasAnchorSweep, closeStream,
+		bob, aliceChanPoint, hasAnchors, closeStream,
 	)
 
 	// Increase the blocks mined. At this step
@@ -1064,12 +1050,7 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 		expectedTxes = 2
 
 	// Carol will broadcast her second level HTLC transaction and Bob will
-	// sweep his commitment and anchor outputs.
-	// For anchor channels, we'd expect to see three transactions,
-	// - Carol's second level HTLC transaction
-	// - Bob's sweep tx spending his commitment output
-	// - Bob's sweep tx spending two anchor outputs, one from channel Alice
-	//   to Bob and the other from channel Bob to Carol.
+	// sweep his commitment and anchor output.
 	case lnrpc.CommitmentType_ANCHORS, lnrpc.CommitmentType_SIMPLE_TAPROOT:
 		expectedTxes = 3
 
@@ -1084,15 +1065,19 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 		ht.Fatalf("unhandled commitment type %v", c)
 	}
 
-	// Assert transactions can be found in the mempool.
-	ht.Miner.AssertNumTxsInMempool(expectedTxes)
+	txes := ht.Miner.GetNumTxsFromMempool(expectedTxes)
+
+	// Both Carol's second level transaction and Bob's sweep should be
+	// spending from the commitment transaction.
+	ht.AssertAllTxesSpendFrom(txes, closingTxid)
 
 	// At this point we suspend Alice to make sure she'll handle the
 	// on-chain settle after a restart.
 	restartAlice := ht.SuspendNode(alice)
 
 	// Mine a block to confirm the expected transactions (+ the coinbase).
-	ht.MineBlocksAndAssertNumTxes(1, expectedTxes)
+	block = ht.MineBlocksAndAssertNumTxes(1, expectedTxes)[0]
+	require.Len(ht, block.Transactions, expectedTxes+1)
 
 	// For non-anchor channel types, the nursery will handle sweeping the
 	// second level output, and it will wait one extra block before
@@ -1102,7 +1087,7 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 	// If this is a channel of the anchor type, we will subtract one block
 	// from the default CSV, as the Sweeper will handle the input, and the
 	// Sweeper sweeps the input as soon as the lock expires.
-	if lntest.CommitTypeHasAnchors(c) {
+	if hasAnchors {
 		secondLevelMaturity = defaultCSV - 1
 	}
 
@@ -1113,7 +1098,6 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 	// will extract the preimage and broadcast a second level tx to claim
 	// the HTLC in his (already closed) channel with Alice.
 	bobSecondLvlTx := ht.Miner.GetNumTxsFromMempool(1)[0]
-	bobSecondLvlTxid := bobSecondLvlTx.TxHash()
 
 	// It should spend from the commitment in the channel with Alice.
 	ht.AssertTxSpendFrom(bobSecondLvlTx, *bobForceClose)
@@ -1135,6 +1119,7 @@ func runMultiHopHtlcLocalChainClaim(ht *lntest.HarnessTest,
 	// We'll now mine a block which should confirm Bob's second layer
 	// transaction.
 	block = ht.MineBlocksAndAssertNumTxes(1, 1)[0]
+	bobSecondLvlTxid := bobSecondLvlTx.TxHash()
 	ht.Miner.AssertTxInBlock(block, &bobSecondLvlTxid)
 
 	// Keep track of Bob's second level maturity, and decrement our track
diff --git a/itest/lnd_onchain_test.go b/itest/lnd_onchain_test.go
index 4cfe47d37..4c7a34d48 100644
--- a/itest/lnd_onchain_test.go
+++ b/itest/lnd_onchain_test.go
@@ -521,21 +521,19 @@ func testAnchorThirdPartySpend(ht *lntest.HarnessTest) {
 	require.Equal(ht, testMemo,
 		pendingChannelsResp.WaitingCloseChannels[0].Channel.Memo)
 
-	// At this point, the channel is waiting close so we have the
-	// commitment transaction in the mempool. Alice's anchor, however,
-	// because there's no deadline pressure, it won't be swept.
+	// At this point, the channel is waiting close, and we have both the
+	// commitment transaction and anchor sweep in the mempool.
+	const expectedTxns = 2
+	sweepTxns := ht.Miner.GetNumTxsFromMempool(expectedTxns)
 	aliceCloseTx := waitingClose.Commitments.LocalTxid
-	ht.MineBlocksAndAssertNumTxes(1, 1)
-	forceCloseTxID, _ := chainhash.NewHashFromStr(aliceCloseTx)
-
-	// Mine one block to trigger Alice's sweeper to reconsider the anchor
-	// sweeping. Because we are now sweeping at the fee rate floor, the
-	// sweeper will consider this input has positive yield thus attempts
-	// the sweeping.
-	ht.MineEmptyBlocks(1)
-	sweepTxns := ht.Miner.GetNumTxsFromMempool(1)
 	_, aliceAnchor := ht.FindCommitAndAnchor(sweepTxns, aliceCloseTx)
 
+	// We'll now mine _only_ the commitment force close transaction, as we
+	// want the anchor sweep to stay unconfirmed.
+	forceCloseTxID, _ := chainhash.NewHashFromStr(aliceCloseTx)
+	commitTxn := ht.Miner.GetRawTransaction(forceCloseTxID)
+	ht.Miner.MineBlockWithTxes([]*btcutil.Tx{commitTxn})
+
 	// Assert that the channel is now in PendingForceClose.
 	//
 	// NOTE: We must do this check to make sure `lnd` node has updated its
@@ -575,7 +573,7 @@ func testAnchorThirdPartySpend(ht *lntest.HarnessTest) {
 	// call, we'll generate a series of _empty_ blocks here.
 	aliceRestart := ht.SuspendNode(alice)
 	const anchorCsv = 16
-	ht.MineEmptyBlocks(anchorCsv - 1)
+	ht.MineEmptyBlocks(anchorCsv)
 
 	// Before we sweep the anchor, we'll restart Alice.
 	require.NoErrorf(ht, aliceRestart(), "unable to restart alice")