mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 10:12:28 +02:00
lncli: add flag skip_peer_alias_lookup to fwdinghistory
A new flag skip_peer_alias_lookup is introduced that communicates to the server if the peer alias lookup per forwarding event should be skipped in order to improve performance.
This commit is contained in:
@@ -1297,6 +1297,11 @@ var forwardingHistoryCommand = cli.Command{
|
|||||||
Name: "max_events",
|
Name: "max_events",
|
||||||
Usage: "the max number of events to return",
|
Usage: "the max number of events to return",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "skip_peer_alias_lookup",
|
||||||
|
Usage: "skip the peer alias lookup per forwarding " +
|
||||||
|
"event in order to improve performance",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: actionDecorator(forwardingHistory),
|
Action: actionDecorator(forwardingHistory),
|
||||||
}
|
}
|
||||||
@@ -1347,7 +1352,8 @@ func forwardingHistory(ctx *cli.Context) error {
|
|||||||
case args.Present():
|
case args.Present():
|
||||||
i, err := strconv.ParseInt(args.First(), 10, 64)
|
i, err := strconv.ParseInt(args.First(), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to decode index_offset: %v", err)
|
return fmt.Errorf("unable to decode index_offset: %v",
|
||||||
|
err)
|
||||||
}
|
}
|
||||||
indexOffset = uint32(i)
|
indexOffset = uint32(i)
|
||||||
args = args.Tail()
|
args = args.Tail()
|
||||||
@@ -1359,16 +1365,18 @@ func forwardingHistory(ctx *cli.Context) error {
|
|||||||
case args.Present():
|
case args.Present():
|
||||||
m, err := strconv.ParseInt(args.First(), 10, 64)
|
m, err := strconv.ParseInt(args.First(), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to decode max_events: %v", err)
|
return fmt.Errorf("unable to decode max_events: %v",
|
||||||
|
err)
|
||||||
}
|
}
|
||||||
maxEvents = uint32(m)
|
maxEvents = uint32(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &lnrpc.ForwardingHistoryRequest{
|
req := &lnrpc.ForwardingHistoryRequest{
|
||||||
StartTime: startTime,
|
StartTime: startTime,
|
||||||
EndTime: endTime,
|
EndTime: endTime,
|
||||||
IndexOffset: indexOffset,
|
IndexOffset: indexOffset,
|
||||||
NumMaxEvents: maxEvents,
|
NumMaxEvents: maxEvents,
|
||||||
|
SkipPeerAliasLookup: ctx.Bool("skip_peer_alias_lookup"),
|
||||||
}
|
}
|
||||||
resp, err := client.ForwardingHistory(ctxc, req)
|
resp, err := client.ForwardingHistory(ctxc, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user