mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-02 09:42:31 +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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user