Start sync loops only if -sync=true
parent
cf15f0cf0c
commit
ac5aa2a234
17
blockbook.go
17
blockbook.go
|
@ -116,12 +116,11 @@ func main() {
|
|||
if err := resyncIndex(); err != nil {
|
||||
glog.Fatal("resyncIndex ", err)
|
||||
}
|
||||
go syncIndexLoop()
|
||||
go syncMempoolLoop()
|
||||
chanSyncMempool <- struct{}{}
|
||||
}
|
||||
|
||||
go syncIndexLoop()
|
||||
go syncMempoolLoop()
|
||||
chanSyncMempool <- struct{}{}
|
||||
|
||||
var httpServer *server.HTTPServer
|
||||
if *httpServerBinding != "" {
|
||||
httpServer, err = server.NewHTTPServer(*httpServerBinding, index, mempool)
|
||||
|
@ -184,10 +183,12 @@ func main() {
|
|||
waitForSignalAndShutdown(httpServer, mq, 5*time.Second)
|
||||
}
|
||||
|
||||
close(chanSyncIndex)
|
||||
close(chanSyncMempool)
|
||||
<-chanSyncIndexDone
|
||||
<-chanSyncMempoolDone
|
||||
if *synchronize {
|
||||
close(chanSyncIndex)
|
||||
close(chanSyncMempool)
|
||||
<-chanSyncIndexDone
|
||||
<-chanSyncMempoolDone
|
||||
}
|
||||
}
|
||||
|
||||
func tickAndDebounce(tickTime time.Duration, debounceTime time.Duration, input chan struct{}, f func()) {
|
||||
|
|
Loading…
Reference in New Issue