lnwallet: ensure that we skip dust HTLC's in NewBreachRetribution

This commit is contained in:
Olaoluwa Osuntokun 2018-04-04 17:07:45 -07:00
parent 4e44528bff
commit c393475d39
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -1976,6 +1976,16 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
err error
)
// If the HTLC is dust, then we'll skip it as it doesn't have
// an output on the commitment transaction.
if htlcIsDust(
htlc.Incoming, false,
SatPerKWeight(revokedSnapshot.FeePerKw),
htlc.Amt.ToSatoshis(), chanState.RemoteChanCfg.DustLimit,
) {
continue
}
// We'll generate the original second level witness script now,
// as we'll need it if we're revoking an HTLC output on the
// remote commitment transaction, and *they* go to the second