routing+docs: make sure non-MPP cannot use skipTempErr
This commit is contained in:
3 files changed
+74
-1
No files matched your search
@@ -119,6 +119,10 @@ var (
|
||||
// provided by either a blinded route or a cleartext pubkey.
|
||||
ErrNoTarget = errors.New("destination not set in target or blinded " +
|
||||
"path")
|
||||
|
||||
// ErrSkipTempErr is returned when a non-MPP is made yet the
|
||||
// skipTempErr flag is set.
|
||||
ErrSkipTempErr = errors.New("cannot skip temp error for non-MPP")
|
||||
)
|
||||
|
||||
// ChannelGraphSource represents the source of information about the topology
|
||||
@@ -2450,6 +2454,13 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
|
||||
amt = mpp.TotalMsat()
|
||||
}
|
||||
|
||||
// For non-MPP, there's no such thing as temp error as there's only one
|
||||
// HTLC attempt being made. When this HTLC is failed, the payment is
|
||||
// failed hence cannot be retried.
|
||||
if skipTempErr && mpp == nil {
|
||||
return nil, ErrSkipTempErr
|
||||
}
|
||||
|
||||
// For non-AMP payments the overall payment identifier will be the same
|
||||
// hash as used for this HTLC.
|
||||
paymentIdentifier := htlcHash
|
||||
|
||||
Reference in new issue
Block a user