Skip to content

Commit 7cb6b78

Browse files
committed
lndclient: expose forward history peer alias
1 parent 5df32d6 commit 7cb6b78

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

lightning_client.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,9 @@ type ForwardingHistoryRequest struct {
24312431

24322432
// Offset is the index from which to start querying.
24332433
Offset uint32
2434+
2435+
// PeerAliasLookup enables looking up the alias
2436+
PeerAliasLookup bool
24342437
}
24352438

24362439
// ForwardingHistoryResponse contains the response to a forwarding history
@@ -2462,8 +2465,14 @@ type ForwardingEvent struct {
24622465
// millisatoshis.
24632466
AmountMsatOut lnwire.MilliSatoshi
24642467

2465-
// FeeMsat is the amount of fees earned in millisatoshis,
2468+
// FeeMsat is the amount of fees earned in millisatoshis.
24662469
FeeMsat lnwire.MilliSatoshi
2470+
2471+
// The peer alias of the incoming channel.
2472+
PeerAliasIn string
2473+
2474+
// The peer alias of the outgoing channel
2475+
PeerAliasOut string
24672476
}
24682477

24692478
// ForwardingHistory returns a set of forwarding events for the period queried.
@@ -2478,10 +2487,11 @@ func (s *lightningClient) ForwardingHistory(ctx context.Context,
24782487
response, err := s.client.ForwardingHistory(
24792488
s.adminMac.WithMacaroonAuth(rpcCtx),
24802489
&lnrpc.ForwardingHistoryRequest{
2481-
StartTime: uint64(req.StartTime.Unix()),
2482-
EndTime: uint64(req.EndTime.Unix()),
2483-
IndexOffset: req.Offset,
2484-
NumMaxEvents: req.MaxEvents,
2490+
StartTime: uint64(req.StartTime.Unix()),
2491+
EndTime: uint64(req.EndTime.Unix()),
2492+
IndexOffset: req.Offset,
2493+
NumMaxEvents: req.MaxEvents,
2494+
PeerAliasLookup: req.PeerAliasLookup,
24852495
},
24862496
)
24872497
if err != nil {
@@ -2497,6 +2507,8 @@ func (s *lightningClient) ForwardingHistory(ctx context.Context,
24972507
AmountMsatIn: lnwire.MilliSatoshi(event.AmtInMsat),
24982508
AmountMsatOut: lnwire.MilliSatoshi(event.AmtOutMsat),
24992509
FeeMsat: lnwire.MilliSatoshi(event.FeeMsat),
2510+
PeerAliasIn: event.PeerAliasIn,
2511+
PeerAliasOut: event.PeerAliasOut,
25002512
}
25012513
}
25022514

0 commit comments

Comments
 (0)