Move sync loop after initial resync
parent
4bbbcb0082
commit
cf15f0cf0c
16
blockbook.go
16
blockbook.go
|
@ -112,15 +112,16 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
go syncIndexLoop()
|
||||
go syncMempoolLoop()
|
||||
|
||||
if *synchronize {
|
||||
if err := resyncIndex(); err != nil {
|
||||
glog.Fatal("resyncIndex ", err)
|
||||
}
|
||||
}
|
||||
|
||||
go syncIndexLoop()
|
||||
go syncMempoolLoop()
|
||||
chanSyncMempool <- struct{}{}
|
||||
|
||||
var httpServer *server.HTTPServer
|
||||
if *httpServerBinding != "" {
|
||||
httpServer, err = server.NewHTTPServer(*httpServerBinding, index, mempool)
|
||||
|
@ -363,7 +364,7 @@ func resyncIndex() error {
|
|||
return err
|
||||
}
|
||||
if chainBestHeight-startHeight > uint32(*syncChunk) {
|
||||
glog.Infof("resync: parallel sync of blocks %d-%d", startHeight, chainBestHeight)
|
||||
glog.Infof("resync: parallel sync of blocks %d-%d, using %d workers", startHeight, chainBestHeight, *syncWorkers)
|
||||
err = connectBlocksParallel(
|
||||
startHeight,
|
||||
chainBestHeight,
|
||||
|
@ -379,12 +380,7 @@ func resyncIndex() error {
|
|||
}
|
||||
}
|
||||
|
||||
err = connectBlocks(hash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
chanSyncMempool <- struct{}{}
|
||||
return nil
|
||||
return connectBlocks(hash)
|
||||
}
|
||||
|
||||
func connectBlocks(
|
||||
|
|
Loading…
Reference in New Issue