mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
routing: use probability source in path finding
This PR replaces the previously used edge and node ignore lists in path finding by a probability based system. It modifies path finding so that it not only compares routes on fee and time lock, but also takes route success probability into account. Allowing routes to be compared based on success probability is achieved by introducing a 'virtual' cost of a payment attempt and using that to translate probability into another cost factor.
This commit is contained in:
@@ -25,8 +25,14 @@ type nodeWithDist struct {
|
||||
// node. This value does not include the final cltv.
|
||||
incomingCltv uint32
|
||||
|
||||
// fee is the fee that this node is charging for forwarding.
|
||||
fee lnwire.MilliSatoshi
|
||||
// probability is the probability that from this node onward the route
|
||||
// is successful.
|
||||
probability float64
|
||||
|
||||
// weight is the cost of the route from this node to the destination.
|
||||
// Includes the routing fees and a virtual cost factor to account for
|
||||
// time locks.
|
||||
weight int64
|
||||
}
|
||||
|
||||
// distanceHeap is a min-distance heap that's used within our path finding
|
||||
|
Reference in New Issue
Block a user