Skip to content

Commit

Permalink
Merge e71151f into 0fafd5e
Browse files Browse the repository at this point in the history
  • Loading branch information
wpaulino committed Dec 17, 2018
2 parents 0fafd5e + e71151f commit b2a012a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions htlcswitch/link.go
Expand Up @@ -2398,19 +2398,16 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
// computed correctly.
expectedHeight := heightNow + minCltvDelta
switch {
case !l.cfg.DebugHTLC && pd.Timeout < expectedHeight:
log.Errorf("Incoming htlc(%x) has an "+
"expiration that is too soon: "+
"expected at least %v, got %v",
pd.RHash[:], expectedHeight, pd.Timeout)

case !l.cfg.DebugHTLC && fwdInfo.OutgoingCTLV < expectedHeight:
log.Errorf("Onion payload of incoming "+
"htlc(%x) has incorrect time-lock: "+
"expected %v, got %v",
pd.RHash[:], expectedHeight,
fwdInfo.OutgoingCTLV)

failure := lnwire.NewFinalIncorrectCltvExpiry(
fwdInfo.OutgoingCTLV,
)
failure := lnwire.FailFinalExpiryTooSoon{}
l.sendHTLCError(
pd.HtlcIndex, failure, obfuscator, pd.SourceRef,
pd.HtlcIndex, failure, obfuscator,
pd.SourceRef,
)

needUpdate = true
Expand Down

0 comments on commit b2a012a

Please sign in to comment.