Merge branch 'v0.15.1-beta-6724' into v0.15.1-branch-rc1

This commit is contained in:
Olaoluwa Osuntokun 2022-08-12 16:59:15 -07:00
commit db32955f54
2 changed files with 38 additions and 0 deletions

View File

@ -1028,6 +1028,13 @@ var queryRoutesCommand = cli.Command{
Usage: "(optional) the channel id of the channel " +
"that must be taken to the first hop",
},
cli.StringSliceFlag{
Name: "ignore_pair",
Usage: "ignore directional node pair " +
"<node1>:<node2>. This flag can be specified " +
"multiple times if multiple node pairs are " +
"to be ignored",
},
timePrefFlag,
cltvLimitFlag,
},
@ -1074,6 +1081,31 @@ func queryRoutes(ctx *cli.Context) error {
return err
}
pairs := ctx.StringSlice("ignore_pair")
ignoredPairs := make([]*lnrpc.NodePair, len(pairs))
for i, pair := range pairs {
nodes := strings.Split(pair, ":")
if len(nodes) != 2 {
return fmt.Errorf("invalid node pair format. " +
"Expected <node1 pub key>:<node2 pub key>")
}
node1, err := hex.DecodeString(nodes[0])
if err != nil {
return err
}
node2, err := hex.DecodeString(nodes[1])
if err != nil {
return err
}
ignoredPairs[i] = &lnrpc.NodePair{
From: node1,
To: node2,
}
}
req := &lnrpc.QueryRoutesRequest{
PubKey: dest,
Amt: amt,
@ -1083,6 +1115,7 @@ func queryRoutes(ctx *cli.Context) error {
CltvLimit: uint32(ctx.Uint64(cltvLimitFlag.Name)),
OutgoingChanId: ctx.Uint64("outgoing_chanid"),
TimePref: ctx.Float64(timePrefFlag.Name),
IgnoredPairs: ignoredPairs,
}
route, err := client.QueryRoutes(ctxc, req)

View File

@ -25,6 +25,11 @@
`updatechanstatus`](https://github.com/lightningnetwork/lnd/pull/6705)
to offer a convenient way to specify the channel to be updated.
* [Add `ignore_pair` flag to
queryroutes](https://github.com/lightningnetwork/lnd/pull/6724) to allow a
user to request that specific directional node pairs be ignored during the
route search.
## Database
* [Delete failed payment attempts](https://github.com/lightningnetwork/lnd/pull/6438)