Merge pull request #2939 from Roasbeef/hodl-htlc-fix

htlcswitch: only perform CLTV checks for HTLCs with open invoices
This commit is contained in:
Olaoluwa Osuntokun 2019-04-15 12:52:45 -07:00 committed by GitHub
commit 8418dc5530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2792,7 +2792,7 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
expectedHeight := heightNow + minCltvDelta expectedHeight := heightNow + minCltvDelta
switch { switch {
case !l.cfg.DebugHTLC && case !l.cfg.DebugHTLC &&
invoice.Terms.State != channeldb.ContractAccepted && invoice.Terms.State == channeldb.ContractOpen &&
pd.Timeout < expectedHeight: pd.Timeout < expectedHeight:
log.Errorf("Incoming htlc(%x) has an expiration that is too "+ log.Errorf("Incoming htlc(%x) has an expiration that is too "+