Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Jul 22, 2024
1 parent 674881a commit df9ea93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ func (m *Monitor) syncLastBlock() uint64 {
m.taskCh <- rpcBlock
}

for n := 0; n < len(blocks); n++ {
size := len(blocks)
for n := 0; n < size; n++ {
select {
case err := <-m.errCh:
if err != nil {
Expand All @@ -603,8 +604,8 @@ func (m *Monitor) syncLastBlock() uint64 {
return 0
}
}
i += uint64(len(blocks))
counter += len(blocks)
i += uint64(size)
counter += size
} else {
rpcBlock, rpcErr := m.rpcBlockByNumber(i)
if rpcErr != nil {
Expand Down

0 comments on commit df9ea93

Please sign in to comment.