cnct: do not create an action for incoming dust htlcs
This commit fixes the 'unable to find incoming resolution' error that occured when trying to resolve incoming htlcs below the dust limit that are not actually present on the commitment tx.
This commit is contained in:
parent
3131bc4d64
commit
be7fc9dd3e
@ -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[:])
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user