|
|
|
@ -212,11 +212,8 @@ TASK_LOOP: |
|
|
|
|
bc := &blockchain.Blockchain{ |
|
|
|
|
Blocks: make([]*blockchain.Block, blockSize), |
|
|
|
|
} |
|
|
|
|
// loop to do syncing.
|
|
|
|
|
for { |
|
|
|
|
var wg sync.WaitGroup |
|
|
|
|
wg.Add(activePeerNumber) |
|
|
|
|
|
|
|
|
|
wg.Add(activePeerNumber) |
|
|
|
|
for _, configPeer := range syncConfig.peers { |
|
|
|
|
if configPeer.err != nil { |
|
|
|
|
continue |
|
|
|
@ -246,7 +243,6 @@ TASK_LOOP: |
|
|
|
|
}(&configPeer, taskSyncQueue, bc) |
|
|
|
|
} |
|
|
|
|
wg.Wait() |
|
|
|
|
} |
|
|
|
|
return bc |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|