mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 10:35:32 +02:00
lncli+routerrpc: dynamic capacity fraction config
Enable setting and getting of the apriori capacity fraction in lncli and in the router rpc.
This commit is contained in:
@ -14,6 +14,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lntest/node"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/routing"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
@ -1023,9 +1024,10 @@ func testMissionControlCfg(t *testing.T, hn *node.HarnessNode) {
|
||||
MissionControlConfig_APRIORI,
|
||||
EstimatorConfig: &routerrpc.MissionControlConfig_Apriori{
|
||||
Apriori: &routerrpc.AprioriParameters{
|
||||
HalfLifeSeconds: 8000,
|
||||
HopProbability: 0.8,
|
||||
Weight: 0.3,
|
||||
HalfLifeSeconds: 8000,
|
||||
HopProbability: 0.8,
|
||||
Weight: 0.3,
|
||||
CapacityFraction: 0.8,
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1071,6 +1073,10 @@ func testMissionControlCfg(t *testing.T, hn *node.HarnessNode) {
|
||||
respCfg = hn.RPC.GetMissionControlConfig().Config
|
||||
require.NotNil(t, respCfg.GetApriori())
|
||||
|
||||
// The default capacity fraction is set.
|
||||
require.Equal(t, routing.DefaultCapacityFraction,
|
||||
respCfg.GetApriori().CapacityFraction)
|
||||
|
||||
// Setting the wrong config results in an error.
|
||||
cfg = &routerrpc.MissionControlConfig{
|
||||
Model: routerrpc.
|
||||
|
Reference in New Issue
Block a user