Skip to content

Commit 298c180

Browse files
committed
fixup! loopd: add notification manager
1 parent fe552d9 commit 298c180

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

loopd/daemon.go

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -501,27 +501,14 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
501501

502502
// Start the notification manager.
503503
notificationCfg := &notifications.Config{
504-
Client: loop_swaprpc.NewSwapServerClient(swapClient.Conn),
504+
Client: loop_swaprpc.NewSwapServerClient(swapClient.Conn),
505+
FetchL402: d.impl.Server.FetchL402,
505506
}
506507
notificationManager := notifications.NewManager(notificationCfg)
507508

508-
d.wg.Add(1)
509-
notificationInitChan := make(chan struct{})
510-
go func() {
511-
defer d.wg.Done()
512-
err = notificationManager.Run(d.mainCtx, notificationInitChan)
513-
if err != nil {
514-
d.internalErrChan <- err
515-
}
516-
}()
517-
518-
select {
519-
case <-notificationInitChan:
520-
break
521-
case <-time.After(15 * time.Second):
522-
return fmt.Errorf("notification manager not ready")
523-
case <-d.mainCtx.Done():
524-
return fmt.Errorf("notification manager not ready: %v", d.mainCtx.Err())
509+
err = notificationManager.Run(d.mainCtx)
510+
if err != nil {
511+
return err
525512
}
526513

527514
var (

0 commit comments

Comments
 (0)