lnwire+htlcswitch: report height for invalid payment details failure
Extends the invalid payment details failure with the new accept height field. This allows sender to distinguish between a genuine invalid details situation and a delay caused by intermediate nodes.
This commit is contained in:
9 files changed
+212
-118
No files matched your search
+2
-2
@@ -1206,7 +1206,7 @@ func (l *channelLink) processHodlEvent(hodlEvent invoices.HodlEvent,
|
||||
// In case of a cancel, always return
|
||||
// incorrect_or_unknown_payment_details in order to avoid leaking info.
|
||||
failure := lnwire.NewFailIncorrectDetails(
|
||||
htlc.pd.Amount,
|
||||
htlc.pd.Amount, uint32(hodlEvent.AcceptHeight),
|
||||
)
|
||||
|
||||
l.sendHTLCError(
|
||||
@@ -2867,7 +2867,7 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
|
||||
|
||||
// Cancel htlc if we don't have an invoice for it.
|
||||
case channeldb.ErrInvoiceNotFound:
|
||||
failure := lnwire.NewFailIncorrectDetails(pd.Amount)
|
||||
failure := lnwire.NewFailIncorrectDetails(pd.Amount, heightNow)
|
||||
l.sendHTLCError(pd.HtlcIndex, failure, obfuscator, pd.SourceRef)
|
||||
|
||||
return true, nil
|
||||
|
||||
Reference in new issue
Block a user