mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-30 16:10:01 +01:00
routing: implement route failure fallback in SendPayment
This commit adds payment route failure fallback to SendPayment. By this, we mean that we now take all the possible routes found during path finding and try them in series. Either a route fails and we move onto the next one, or the route is successful and we terminate early. With this commit, sending payments using lnd is now much more robust as if there exists an eligible route with sufficient capacity, it will be utilized.
This commit is contained in:
@@ -8,6 +8,12 @@ var (
|
||||
ErrNoPathFound = errors.New("unable to find a path to " +
|
||||
"destination")
|
||||
|
||||
// ErrNoRouteFound is returned when the router is unable to find a
|
||||
// valid route to the target destination after fees and time-lock
|
||||
// limitations are factored in.
|
||||
ErrNoRouteFound = errors.New("unable to find a eligible route to " +
|
||||
"the destination")
|
||||
|
||||
// ErrInsufficientCapacity is returned when a path if found, yet the
|
||||
// capacity of one of the channels in the path is insufficient to carry
|
||||
// the payment.
|
||||
@@ -18,6 +24,8 @@ var (
|
||||
// the length of that path exceeds HopLimit.
|
||||
ErrMaxHopsExceeded = errors.New("potential path has too many hops")
|
||||
|
||||
// ErrTargetNotInNetwork is returned when a
|
||||
// ErrTargetNotInNetwork is returned when the target of a path-finding
|
||||
// or payment attempt isn't known to be within the current version of
|
||||
// the channel graph.
|
||||
ErrTargetNotInNetwork = errors.New("target not found")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user