From dde94ea1fb638dc51c6a0e5a046f851f5afdb68a Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Wed, 20 Dec 2023 19:22:43 +0100 Subject: [PATCH] staticaddr: feed manager with initial block height --- loopd/daemon.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 }