Merge pull request #2802 from joostjager/probability

routing: probability based path finding
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-06-05 11:30:55 +02:00
commit 7453dbeacc
27 files changed
+1600 -423

No files matched your search

+9 -4
View File
@@ -95,6 +95,12 @@ func createTestCtxFromGraphInstance(startingHeight uint32, graphInstance *testGr
func(e *channeldb.ChannelEdgeInfo) lnwire.MilliSatoshi {
return lnwire.NewMSatFromSatoshis(e.Capacity)
},
&MissionControlConfig{
MinRouteProbability: 0.01,
PaymentAttemptPenalty: 100,
PenaltyHalfLife: time.Hour,
AprioriHopProbability: 0.9,
},
)
router, err := New(Config{
Graph: graphInstance.graph,
@@ -201,7 +207,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 +2205,7 @@ func TestFindPathFeeWeighting(t *testing.T) {
&graphParams{
graph: ctx.graph,
},
&RestrictParams{
FeeLimit: noFeeLimit,
},
noRestrictions,
sourceNode.PubKeyBytes, target, amt,
)
if err != nil {