Skip to content

Commit

Permalink
staticaddr: feed manager with initial block height
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Dec 22, 2023
1 parent 7b77da5 commit b2f400c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion loopd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
SwapClient: swapClient,
Store: store,
Lnd: d.lnd.LndServices,
ChainNotifier: d.lnd.ChainNotifier,
}
staticAddressManager := staticaddr.NewAddressManager(cfg)

Expand Down Expand Up @@ -577,8 +578,15 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
go func() {
defer d.wg.Done()

// Lnd's GetInfo call supplies us with the current block height.
info, err := d.lnd.Client.GetInfo(d.mainCtx)
if err != nil {
d.internalErrChan <- err
return
}

log.Info("Starting static address manager...")
err = staticAddressManager.Run(d.mainCtx)
err = staticAddressManager.Run(d.mainCtx, info.BlockHeight)
if err != nil && !errors.Is(context.Canceled, err) {
d.internalErrChan <- err
}
Expand Down

0 comments on commit b2f400c

Please sign in to comment.