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:
Slyghtning committed 2022-10-18 11:08:03 -04:00
1 parent 425ce55968
commit 2db62c18a1
1 file changed
+10 -2
+10 -2
View File
@@ -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,7 +1365,8 @@ 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)
} }
@@ -1369,6 +1376,7 @@ func forwardingHistory(ctx *cli.Context) error {
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 {