|
|
@ -95,7 +95,6 @@ func NewDownloader(host p2p.Host, bc core.BlockChain, isBeaconNode bool, config |
|
|
|
func (d *Downloader) Start() { |
|
|
|
func (d *Downloader) Start() { |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
d.waitForBootFinish() |
|
|
|
d.waitForBootFinish() |
|
|
|
fmt.Printf("boot completed for shard %d, %d streams are connected\n", d.bc.ShardID(), d.syncProtocol.NumStreams()) |
|
|
|
|
|
|
|
d.loop() |
|
|
|
d.loop() |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
@ -178,6 +177,7 @@ func (d *Downloader) waitForBootFinish() { |
|
|
|
|
|
|
|
|
|
|
|
case <-checkCh: |
|
|
|
case <-checkCh: |
|
|
|
if d.syncProtocol.NumStreams() >= d.config.InitStreams { |
|
|
|
if d.syncProtocol.NumStreams() >= d.config.InitStreams { |
|
|
|
|
|
|
|
fmt.Printf("boot completed for shard %d ( %d streams are connected )\n", d.bc.ShardID(), d.syncProtocol.NumStreams()) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
case <-d.closeC: |
|
|
|
case <-d.closeC: |
|
|
|