Merge pull request #1448 from Roasbeef/check-invoice-min-final

channeldb+htlcswitch: use the final min cltv delta in the invoice when link at exit hop
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-06-28 18:39:33 -07:00
commit 3a47c41c6b
4 files changed
+28 -7

No files matched your search

+2 -3
View File
@@ -2258,9 +2258,8 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
// We'll also ensure that our time-lock value has been
// computed correctly.
//
// TODO(roasbeef): also accept global default?
expectedHeight := heightNow + l.cfg.FwrdingPolicy.TimeLockDelta
minCltvDelta := uint32(invoice.Terms.FinalCltvDelta)
expectedHeight := heightNow + minCltvDelta
switch {
case !l.cfg.DebugHTLC && fwdInfo.OutgoingCTLV < expectedHeight: