Skip to content

Commit b2f400c

Browse files
committed
staticaddr: feed manager with initial block height
1 parent 7b77da5 commit b2f400c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

loopd/daemon.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
501501
SwapClient: swapClient,
502502
Store: store,
503503
Lnd: d.lnd.LndServices,
504+
ChainNotifier: d.lnd.ChainNotifier,
504505
}
505506
staticAddressManager := staticaddr.NewAddressManager(cfg)
506507

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

581+
// Lnd's GetInfo call supplies us with the current block height.
582+
info, err := d.lnd.Client.GetInfo(d.mainCtx)
583+
if err != nil {
584+
d.internalErrChan <- err
585+
return
586+
}
587+
580588
log.Info("Starting static address manager...")
581-
err = staticAddressManager.Run(d.mainCtx)
589+
err = staticAddressManager.Run(d.mainCtx, info.BlockHeight)
582590
if err != nil && !errors.Is(context.Canceled, err) {
583591
d.internalErrChan <- err
584592
}

0 commit comments

Comments
 (0)