lnrpc+lncli: rename skip_peer_alias_lookup to reflect opt-in behavior

This commit is contained in:
Slyghtning committed 2022-10-27 07:11:19 -04:00
1 parent 55d62f8bab
commit 46b8de35ac
5 files changed
+776 -772

No files matched your search

+9 -5
View File
@@ -1371,12 +1371,16 @@ func forwardingHistory(ctx *cli.Context) error {
maxEvents = uint32(m) maxEvents = uint32(m)
} }
// By default we will look up the peers' alias information unless the
// skip_peer_alias_lookup flag is specified.
lookupPeerAlias := !ctx.Bool("skip_peer_alias_lookup")
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"), PeerAliasLookup: lookupPeerAlias,
} }
resp, err := client.ForwardingHistory(ctxc, req) resp, err := client.ForwardingHistory(ctxc, req)
if err != nil { if err != nil {
+761 -761
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -4059,9 +4059,9 @@ message ForwardingHistoryRequest {
// The max number of events to return in the response to this query. // The max number of events to return in the response to this query.
uint32 num_max_events = 4; uint32 num_max_events = 4;
// Informs the server if the peer alias lookup per forwarding event // Informs the server if the peer alias should be looked up for each
// should be skipped in order to improve performance. // forwarding event.
bool skip_peer_alias_lookup = 5; bool peer_alias_lookup = 5;
} }
message ForwardingEvent { message ForwardingEvent {
// Timestamp is the time (unix epoch offset) that this circuit was // Timestamp is the time (unix epoch offset) that this circuit was
+2 -2
View File
@@ -4496,9 +4496,9 @@
"format": "int64", "format": "int64",
"description": "The max number of events to return in the response to this query." "description": "The max number of events to return in the response to this query."
}, },
"skip_peer_alias_lookup": { "peer_alias_lookup": {
"type": "boolean", "type": "boolean",
"description": "Informs the server if the peer alias lookup per forwarding event\nshould be skipped in order to improve performance." "description": "Informs the server if the peer alias should be looked up for each\nforwarding event."
} }
} }
}, },
+1 -1
View File
@@ -6892,7 +6892,7 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
AmtOutMsat: uint64(amtOutMsat), AmtOutMsat: uint64(amtOutMsat),
} }
if !req.SkipPeerAliasLookup { if req.PeerAliasLookup {
aliasIn, err := getRemoteAlias(event.IncomingChanID) aliasIn, err := getRemoteAlias(event.IncomingChanID)
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to lookup peer "+ return nil, fmt.Errorf("unable to lookup peer "+