mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 02:02:17 +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",
|
||||
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),
|
||||
}
|
||||
@@ -1347,7 +1352,8 @@ func forwardingHistory(ctx *cli.Context) error {
|
||||
case args.Present():
|
||||
i, err := strconv.ParseInt(args.First(), 10, 64)
|
||||
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)
|
||||
args = args.Tail()
|
||||
@@ -1359,16 +1365,18 @@ func forwardingHistory(ctx *cli.Context) error {
|
||||
case args.Present():
|
||||
m, err := strconv.ParseInt(args.First(), 10, 64)
|
||||
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)
|
||||
}
|
||||
|
||||
req := &lnrpc.ForwardingHistoryRequest{
|
||||
StartTime: startTime,
|
||||
EndTime: endTime,
|
||||
IndexOffset: indexOffset,
|
||||
NumMaxEvents: maxEvents,
|
||||
StartTime: startTime,
|
||||
EndTime: endTime,
|
||||
IndexOffset: indexOffset,
|
||||
NumMaxEvents: maxEvents,
|
||||
SkipPeerAliasLookup: ctx.Bool("skip_peer_alias_lookup"),
|
||||
}
|
||||
resp, err := client.ForwardingHistory(ctxc, req)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user