Skip to content

Commit b79b8eb

Browse files
committed
tapchannel: use correct set of htlcOutputs for HTLC tap descs
1 parent d176835 commit b79b8eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tapchannel/aux_sweeper.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,9 @@ func (a *AuxSweeper) resolveContract(
16941694
// assets for the remote party, which are actually the HTLCs we
16951695
// sent outgoing. We only care about this particular HTLC, so
16961696
// we'll filter out the rest.
1697-
htlcOutputs := commitState.IncomingHtlcAssets.Val
1697+
//
1698+
// TODO(roasbeef): fix comment above?
1699+
htlcOutputs := commitState.OutgoingHtlcAssets.Val
16981700
assetOutputs = htlcOutputs.FilterByHtlcIndex(
16991701
req.HtlcID.UnwrapOr(math.MaxUint64),
17001702
)
@@ -1719,7 +1721,7 @@ func (a *AuxSweeper) resolveContract(
17191721
// In this case, it's an outgoing HTLC from the PoV of the
17201722
// remote party, which is incoming for us. We'll only sweep this
17211723
// HTLC, so we'll filter out the rest.
1722-
htlcOutputs := commitState.OutgoingHtlcAssets.Val
1724+
htlcOutputs := commitState.IncomingHtlcAssets.Val
17231725
assetOutputs = htlcOutputs.FilterByHtlcIndex(
17241726
req.HtlcID.UnwrapOr(math.MaxUint64),
17251727
)
@@ -1758,7 +1760,7 @@ func (a *AuxSweeper) resolveContract(
17581760
// needed to sweep both this output, as well as the second level
17591761
// output it creates.
17601762
case input.TaprootHtlcAcceptedLocalSuccess:
1761-
htlcOutputs := commitState.OutgoingHtlcAssets.Val
1763+
htlcOutputs := commitState.IncomingHtlcAssets.Val
17621764
assetOutputs = htlcOutputs.FilterByHtlcIndex(
17631765
req.HtlcID.UnwrapOr(math.MaxUint64),
17641766
)

0 commit comments

Comments
 (0)