Merge pull request #2794 from halseth/autopilot-query-heuristic-no-active-agent

autopilot: move queryHeuristic out of agent
This commit is contained in:
Olaoluwa Osuntokun
2019-03-21 20:20:51 -07:00
committed by GitHub
6 changed files with 145 additions and 104 deletions

View File

@@ -97,9 +97,16 @@ func disable(ctx *cli.Context) error {
var queryScoresCommand = cli.Command{
Name: "query",
Usage: "Query the autopilot heuristcs for nodes' scores.",
ArgsUsage: "<pubkey> <pubkey> <pubkey> ...",
ArgsUsage: "[flags] <pubkey> <pubkey> <pubkey> ...",
Description: "",
Action: actionDecorator(queryScores),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "ignorelocalstate, i",
Usage: "Ignore local channel state when calculating " +
"scores.",
},
},
}
func queryScores(ctx *cli.Context) error {
@@ -123,7 +130,8 @@ loop:
}
req := &autopilotrpc.QueryScoresRequest{
Pubkeys: pubs,
Pubkeys: pubs,
IgnoreLocalState: ctx.Bool("ignorelocalstate"),
}
resp, err := client.QueryScores(ctxb, req)