mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
routing: add handling for blinded errors from final node
We do not expect blinding errors from the final node: 1. If the introduction is the recipient, they should use regular errors. 2. Otherwise, nodes have no business sending this error when they are not part of a blinded route.
This commit is contained in:
@@ -267,6 +267,21 @@ func (i *interpretedResult) processPaymentOutcomeFinal(
|
||||
// destination correctly. Continue the payment process.
|
||||
i.successPairRange(route, 0, n-1)
|
||||
|
||||
// We do not expect to receive an invalid blinding error from the final
|
||||
// node in the route. This could erroneously happen in the following
|
||||
// cases:
|
||||
// 1. Unblinded node: misuses the error code.
|
||||
// 2. A receiving introduction node: erroneously sends the error code,
|
||||
// as the spec indicates that receiving introduction nodes should
|
||||
// use regular errors.
|
||||
//
|
||||
// Note that we expect the case where this error is sent from a node
|
||||
// after the introduction node to be handled elsewhere as this is part
|
||||
// of a more general class of errors where the introduction node has
|
||||
// failed to convert errors for the blinded route.
|
||||
case *lnwire.FailInvalidBlinding:
|
||||
failNode()
|
||||
|
||||
// All other errors are considered terminal if coming from the
|
||||
// final hop. They indicate that something is wrong at the
|
||||
// recipient, so we do apply a penalty.
|
||||
|
Reference in New Issue
Block a user