lnd+lnrpc: update fwdinghistory message

In this commit we update the returned message for fwdinghistory
to include the htlcindex for all forwarded htlcs.
This commit is contained in:
Abdullahi Yunus
2025-05-15 12:24:42 +01:00
parent f79e6137c1
commit a0634e4ade
5 changed files with 860 additions and 778 deletions

View File

@@ -8100,6 +8100,16 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
AmtOutMsat: uint64(amtOutMsat),
}
// If the incoming htlc id is present, add it to the response.
event.IncomingHtlcID.WhenSome(func(id uint64) {
resp.ForwardingEvents[i].IncomingHtlcId = &id
})
// If the outgoing htlc id is present, add it to the response.
event.OutgoingHtlcID.WhenSome(func(id uint64) {
resp.ForwardingEvents[i].OutgoingHtlcId = &id
})
if req.PeerAliasLookup {
aliasIn, err := getRemoteAlias(event.IncomingChanID)
if err != nil {