Start to sync
()
| 327 | |
| 328 | //Start to sync |
| 329 | func (this *BlockSyncMgr) Start() { |
| 330 | go this.sync() |
| 331 | ticker := time.NewTicker(time.Second) |
| 332 | defer ticker.Stop() |
| 333 | for { |
| 334 | select { |
| 335 | case <-this.exitCh: |
| 336 | return |
| 337 | case <-ticker.C: |
| 338 | go this.checkTimeout() |
| 339 | go this.sync() |
| 340 | go this.saveBlock() |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | func (this *BlockSyncMgr) checkTimeout() { |
| 346 | now := time.Now() |
nothing calls this directly
no test coverage detected