Skip to content

Commit a2cce3c

Browse files
authored
Merge pull request #999 from hieblmi/more-logging
staticaddr: log errors in manager.Run
2 parents 70cf2d8 + 0ee9a61 commit a2cce3c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

staticaddr/deposit/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,16 @@ func NewManager(cfg *ManagerConfig) *Manager {
106106
func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
107107
newBlockChan, newBlockErrChan, err := m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx) //nolint:lll
108108
if err != nil {
109+
log.Errorf("unable to register block epoch notifier: %v", err)
110+
109111
return err
110112
}
111113

112114
// Recover previous deposits and static address parameters from the DB.
113115
err = m.recoverDeposits(ctx)
114116
if err != nil {
117+
log.Errorf("unable to recover deposits: %v", err)
118+
115119
return err
116120
}
117121

staticaddr/loopin/manager.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,24 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
152152
registerBlockNtfn := m.cfg.ChainNotifier.RegisterBlockEpochNtfn
153153
newBlockChan, newBlockErrChan, err := registerBlockNtfn(ctx)
154154
if err != nil {
155+
log.Errorf("unable to register for block notifications: %v",
156+
err)
157+
155158
return err
156159
}
157160

158161
// Upon start of the loop-in manager we reinstate all previous loop-ins
159162
// that are not yet completed.
160163
err = m.recoverLoopIns(ctx)
161164
if err != nil {
165+
log.Errorf("unable to recover loop-ins: %v", err)
166+
162167
return err
163168
}
164169

165170
// Register for notifications of loop-in sweep requests.
166171
sweepReqs := m.cfg.NotificationManager.
167-
SubscribeStaticLoopInSweepRequests(
168-
ctx,
169-
)
172+
SubscribeStaticLoopInSweepRequests(ctx)
170173

171174
// Communicate to the caller that the address manager has completed its
172175
// initialization.

staticaddr/withdraw/manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,16 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
152152
m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx)
153153

154154
if err != nil {
155+
log.Errorf("unable to register for block epoch "+
156+
"notifications: %v", err)
157+
155158
return err
156159
}
157160

158161
err = m.recoverWithdrawals(ctx)
159162
if err != nil {
163+
log.Errorf("unable to recover withdrawals: %v", err)
164+
160165
return err
161166
}
162167

0 commit comments

Comments
 (0)