Skip to content

Commit

Permalink
fix potential null pointer (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylsGit authored Apr 24, 2024
1 parent 0c81f34 commit b447dc5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sequencer/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func (s *Sequencer) Start(ctx context.Context) {
s.updateDataStreamerFile(ctx, s.cfg.StreamServer.ChainID)
}

s.workerReadyTxsCond = newTimeoutCond(&sync.Mutex{})
s.worker = NewWorker(s.stateIntf, s.batchCfg.Constraints, s.workerReadyTxsCond)
s.finalizer = newFinalizer(s.cfg.Finalizer, s.poolCfg, s.worker, s.pool, s.stateIntf, s.etherman, s.address, s.isSynced, s.batchCfg.Constraints, s.eventLog, s.streamServer, s.workerReadyTxsCond, s.dataToStream)

go s.loadFromPool(ctx)

go s.countPendingTx()
Expand All @@ -104,9 +108,6 @@ func (s *Sequencer) Start(ctx context.Context) {
go s.sendDataToStreamer(s.cfg.StreamServer.ChainID)
}

s.workerReadyTxsCond = newTimeoutCond(&sync.Mutex{})
s.worker = NewWorker(s.stateIntf, s.batchCfg.Constraints, s.workerReadyTxsCond)
s.finalizer = newFinalizer(s.cfg.Finalizer, s.poolCfg, s.worker, s.pool, s.stateIntf, s.etherman, s.address, s.isSynced, s.batchCfg.Constraints, s.eventLog, s.streamServer, s.workerReadyTxsCond, s.dataToStream)
go s.finalizer.Start(ctx)

go s.deleteOldPoolTxs(ctx)
Expand Down

0 comments on commit b447dc5

Please sign in to comment.