mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
staticaddr: log errors in manager.Run
This commit is contained in:
parent
70cf2d828f
commit
0ee9a617e6
3 changed files with 15 additions and 3 deletions
|
|
@ -106,12 +106,16 @@ func NewManager(cfg *ManagerConfig) *Manager {
|
|||
func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
|
||||
newBlockChan, newBlockErrChan, err := m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx) //nolint:lll
|
||||
if err != nil {
|
||||
log.Errorf("unable to register block epoch notifier: %v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Recover previous deposits and static address parameters from the DB.
|
||||
err = m.recoverDeposits(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("unable to recover deposits: %v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,6 +152,9 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
|
|||
registerBlockNtfn := m.cfg.ChainNotifier.RegisterBlockEpochNtfn
|
||||
newBlockChan, newBlockErrChan, err := registerBlockNtfn(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("unable to register for block notifications: %v",
|
||||
err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -159,14 +162,14 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
|
|||
// that are not yet completed.
|
||||
err = m.recoverLoopIns(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("unable to recover loop-ins: %v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Register for notifications of loop-in sweep requests.
|
||||
sweepReqs := m.cfg.NotificationManager.
|
||||
SubscribeStaticLoopInSweepRequests(
|
||||
ctx,
|
||||
)
|
||||
SubscribeStaticLoopInSweepRequests(ctx)
|
||||
|
||||
// Communicate to the caller that the address manager has completed its
|
||||
// initialization.
|
||||
|
|
|
|||
|
|
@ -152,11 +152,16 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
|
|||
m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("unable to register for block epoch "+
|
||||
"notifications: %v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
err = m.recoverWithdrawals(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("unable to recover withdrawals: %v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue