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

@@ -201,7 +201,8 @@ func TestFindRoutesWithFeeLimit(t *testing.T) {
target := ctx.aliases["sophon"]
paymentAmt := lnwire.NewMSatFromSatoshis(100)
restrictions := &RestrictParams{
FeeLimit: lnwire.NewMSatFromSatoshis(10),
FeeLimit: lnwire.NewMSatFromSatoshis(10),
ProbabilitySource: noProbabilitySource,
}
route, err := ctx.router.FindRoute(
@@ -2198,9 +2199,7 @@ func TestFindPathFeeWeighting(t *testing.T) {
&graphParams{
graph: ctx.graph,
},
&RestrictParams{
FeeLimit: noFeeLimit,
},
noRestrictions,
sourceNode.PubKeyBytes, target, amt,
)
if err != nil {