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 Feb 23, 2024
1 parent 0fdf16d commit 298ba8e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion loopd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
Store: store,
WalletKit: d.lnd.WalletKit,
ChainParams: d.lnd.ChainParams,
ChainNotifier: d.lnd.ChainNotifier,
Signer: d.lnd.Signer,
}
staticAddressManager := staticaddr.NewAddressManager(cfg)

Expand Down Expand Up @@ -666,8 +668,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 298ba8e

Please sign in to comment.