lnd+routing+rpc: switch mc to (external) estimator

We use a more general `Estimator` interface for probability estimation
in missioncontrol.

The estimator is created outside of `NewMissionControl`, passed in as a
`MissionControlConfig` field, to facilitate usage of externally supplied
estimators.
This commit is contained in:
bitromortac
2023-01-20 11:25:53 +01:00
parent 686816d784
commit 16986ee5c7
8 changed files with 96 additions and 64 deletions

View File

@@ -67,7 +67,10 @@ func TestProbabilityExtrapolation(t *testing.T) {
// If we use a static value for the node probability (no extrapolation
// of data from other channels), all ten bad channels will be tried
// first before switching to the paid channel.
ctx.mcCfg.AprioriWeight = 1
estimator, ok := ctx.mcCfg.Estimator.(*AprioriEstimator)
if ok {
estimator.AprioriWeight = 1
}
attempts, err = ctx.testPayment(1)
require.NoError(t, err, "payment failed")
if len(attempts) != 11 {