diff --git a/loopd/daemon.go b/loopd/daemon.go index b851fcc17..18fde1c05 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -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) @@ -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 }