MCPcopy Create free account
hub / github.com/DNAProject/DNA / Start

Method Start

p2pserver/block_sync.go:329–343  ·  view source on GitHub ↗

Start to sync

()

Source from the content-addressed store, hash-verified

327
328//Start to sync
329func (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
345func (this *BlockSyncMgr) checkTimeout() {
346 now := time.Now()

Callers

nothing calls this directly

Calls 4

syncMethod · 0.95
checkTimeoutMethod · 0.95
saveBlockMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected