diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 47004d1d..9008894f 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -1316,6 +1316,15 @@ func (c *ChannelArbitrator) checkCommitChainActions(height uint32, // either learn of it eventually from the outgoing HTLC, or the sender // will timeout the HTLC. for _, htlc := range htlcs.incomingHTLCs { + // If the HTLC is dust, there is no action to be taken. + if htlc.OutputIndex < 0 { + log.Debugf("ChannelArbitrator(%v): no resolution "+ + "needed for incoming dust htlc=%x", + c.cfg.ChanPoint, htlc.RHash[:]) + + continue + } + log.Tracef("ChannelArbitrator(%v): watching chain to decide "+ "action for incoming htlc=%x", c.cfg.ChanPoint, htlc.RHash[:]) diff --git a/contractcourt/channel_arbitrator_test.go b/contractcourt/channel_arbitrator_test.go index c0f78e62..7b413669 100644 --- a/contractcourt/channel_arbitrator_test.go +++ b/contractcourt/channel_arbitrator_test.go @@ -527,8 +527,15 @@ func TestChannelArbitratorLocalForceClosePendingHtlc(t *testing.T) { OutputIndex: -1, } + incomingDustHtlc := channeldb.HTLC{ + Incoming: true, + Amt: 105, + HtlcIndex: 101, + OutputIndex: -1, + } + htlcSet := []channeldb.HTLC{ - htlc, outgoingDustHtlc, + htlc, outgoingDustHtlc, incomingDustHtlc, } htlcUpdates <- &ContractUpdate{