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:
Joost Jager
2019-03-19 11:45:10 +01:00
parent b6102ad191
commit 6b70791c2d
7 changed files with 327 additions and 118 deletions

View File

@@ -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