Skip to content

Commit 9baf0cd

Browse files
committed
tiny fix
1 parent 8616367 commit 9baf0cd

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

monitor.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,7 @@ func (m *Monitor) syncLastBlock() uint64 {
799799

800800
// batch blocks operation according service category
801801
for _, rpcBlock := range blocks {
802-
//if err := m.solve(rpcBlock); err != nil {
803-
if err := m.taskQueue(rpcBlock); err != nil {
804-
m.lastNumber.Store(i - 1)
805-
log.Error("solve err", "err", err, "last", m.lastNumber.Load())
806-
return 0
807-
}
808-
//i++
802+
m.taskCh <- rpcBlock
809803
}
810804

811805
for n := 0; n < len(blocks); n++ {
@@ -835,7 +829,6 @@ func (m *Monitor) syncLastBlock() uint64 {
835829
m.lastNumber.Store(i - 1)
836830
return 0
837831
}
838-
//m.taskQueue(rpcBlock)
839832
i++
840833
}
841834
}
@@ -848,16 +841,6 @@ func (m *Monitor) syncLastBlock() uint64 {
848841
return uint64(maxNumber - minNumber)
849842
}
850843

851-
func (m *Monitor) taskQueue(task *types.Block) error {
852-
select {
853-
case m.taskCh <- task:
854-
case <-m.exitCh:
855-
return nil
856-
}
857-
858-
return nil
859-
}
860-
861844
// solve block from node
862845
func (m *Monitor) solve(block *types.Block) error {
863846
switch m.srv.Load() {

0 commit comments

Comments
 (0)