routerrpc: add htlc notifier subscribed event

This commit is contained in:
Joost Jager
2022-07-11 15:02:17 +02:00
parent 281cdd4209
commit b85cda2a1d
6 changed files with 484 additions and 376 deletions

View File

@@ -900,6 +900,16 @@ func (s *Server) SubscribeHtlcEvents(req *SubscribeHtlcEventsRequest,
}
defer htlcClient.Cancel()
// Send out an initial subscribed event so that the caller knows the
// point from which new events will be transmitted.
if err := stream.Send(&HtlcEvent{
Event: &HtlcEvent_SubscribedEvent{
SubscribedEvent: &SubscribedEvent{},
},
}); err != nil {
return err
}
for {
select {
case event := <-htlcClient.Updates():