lnrpc: add filters to forwardhistoryrequest
This commit adds incoming and outgoing channel ids filter to forwarding history request to filter events received/forwarded from/to a particular channel
This commit is contained in:
1 parent
92a5d35cff
commit
bfe1edf4ec
8 files changed
+1089
-815
No files matched your search
+11
-4
@@ -7990,13 +7990,20 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
|
||||
numEvents = 100
|
||||
}
|
||||
|
||||
// Create sets of incoming and outgoing channel IDs from the request
|
||||
// for faster lookups for filtering.
|
||||
incomingChanIDs := fn.NewSet(req.IncomingChanIds...)
|
||||
outgoingChanIDs := fn.NewSet(req.OutgoingChanIds...)
|
||||
|
||||
// Next, we'll map the proto request into a format that is understood by
|
||||
// the forwarding log.
|
||||
eventQuery := channeldb.ForwardingEventQuery{
|
||||
StartTime: startTime,
|
||||
EndTime: endTime,
|
||||
IndexOffset: req.IndexOffset,
|
||||
NumMaxEvents: numEvents,
|
||||
StartTime: startTime,
|
||||
EndTime: endTime,
|
||||
IndexOffset: req.IndexOffset,
|
||||
NumMaxEvents: numEvents,
|
||||
IncomingChanIDs: incomingChanIDs,
|
||||
OutgoingChanIDs: outgoingChanIDs,
|
||||
}
|
||||
timeSlice, err := r.server.miscDB.ForwardingLog().Query(eventQuery)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user