diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 5f4cb31d5..93710f047 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -1100,7 +1100,7 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions, // sweepWithDeadline is a helper closure that takes an anchor // resolution and sweeps it with its corresponding deadline. sweepWithDeadline := func(anchor *lnwallet.AnchorResolution, - htlcs htlcSet) error { + htlcs htlcSet, anchorPath string) error { // Find the deadline for this specific anchor. deadline, err := c.findCommitmentDeadline(heightHint, htlcs) @@ -1109,7 +1109,8 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions, } log.Debugf("ChannelArbitrator(%v): pre-confirmation sweep of "+ - "anchor of tx %v", c.cfg.ChanPoint, anchor.CommitAnchor) + "anchor of %s commit tx %v", c.cfg.ChanPoint, + anchorPath, anchor.CommitAnchor) // Prepare anchor output for sweeping. anchorInput := input.MakeBaseInput( @@ -1153,13 +1154,15 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions, for htlcSet, htlcs := range c.activeHTLCs { switch { case htlcSet == LocalHtlcSet && anchors.Local != nil: - err := sweepWithDeadline(anchors.Local, htlcs) + err := sweepWithDeadline(anchors.Local, htlcs, "local") if err != nil { return err } case htlcSet == RemoteHtlcSet && anchors.Remote != nil: - err := sweepWithDeadline(anchors.Remote, htlcs) + err := sweepWithDeadline( + anchors.Remote, htlcs, "remote", + ) if err != nil { return err } @@ -1167,7 +1170,9 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions, case htlcSet == RemotePendingHtlcSet && anchors.RemotePending != nil: - err := sweepWithDeadline(anchors.RemotePending, htlcs) + err := sweepWithDeadline( + anchors.RemotePending, htlcs, "remote pending", + ) if err != nil { return err } diff --git a/lntest/itest/assertions.go b/lntest/itest/assertions.go index d9bb5522f..2cc0e4986 100644 --- a/lntest/itest/assertions.go +++ b/lntest/itest/assertions.go @@ -1613,8 +1613,9 @@ func assertActiveHtlcs(nodes []*lntest.HarnessNode, payHashes ...[]byte) error { // Channel should have exactly the payHashes active. if len(payHashes) != len(htlcHashes) { - return fmt.Errorf("node %x had %v htlcs active, "+ - "expected %v", node.PubKey[:], + return fmt.Errorf("node [%s:%x] had %v "+ + "htlcs active, expected %v", + node.Cfg.Name, node.PubKey[:], len(htlcHashes), len(payHashes)) } @@ -1624,9 +1625,9 @@ func assertActiveHtlcs(nodes []*lntest.HarnessNode, payHashes ...[]byte) error { if _, ok := htlcHashes[h]; ok { continue } - return fmt.Errorf("node %x didn't have the "+ - "payHash %v active", node.PubKey[:], - h) + return fmt.Errorf("node [%s:%x] didn't have: "+ + "the payHash %v active", node.Cfg.Name, + node.PubKey[:], h) } } } diff --git a/lntest/itest/lnd_channel_force_close.go b/lntest/itest/lnd_channel_force_close.go index 7154a4102..df9ca6231 100644 --- a/lntest/itest/lnd_channel_force_close.go +++ b/lntest/itest/lnd_channel_force_close.go @@ -151,8 +151,7 @@ func testCommitmentTransactionDeadline(net *lntest.NetworkHarness, t.t, checkNumWaitingCloseChannels(pendingChanResp, 1), ) - // We should see only one sweep transaction because the anchor - // sweep is skipped. + // Check our sweep transactions can be found in mempool. sweepTxns, err := getNTxsFromMempool( net.Miner.Client, expectedSweepTxNum, minerMempoolTimeout,