stats: add flag to disable sync wait

This commit is contained in:
Travis Person 2020-03-10 06:10:16 +00:00
parent a9dc2aa58b
commit e9a7c8c7fa

View File

@ -22,6 +22,7 @@ func main() {
var repo string = "~/.lotus"
var database string = "lotus"
var reset bool = false
var nosync bool = false
var height int64 = 0
var headlag int = 3
@ -30,6 +31,7 @@ func main() {
flag.Int64Var(&height, "height", height, "block height to start syncing from (0 will resume)")
flag.IntVar(&headlag, "head-lag", headlag, "number of head events to hold to protect against small reorgs")
flag.BoolVar(&reset, "reset", reset, "truncate database before starting stats gathering")
flag.BoolVar(&nosync, "nosync", nosync, "skip waiting for sync")
flag.Parse()
@ -65,9 +67,11 @@ func main() {
}
defer closer()
if !nosync {
if err := WaitForSyncComplete(ctx, api); err != nil {
log.Fatal(err)
}
}
tipsetsCh, err := GetTips(ctx, api, abi.ChainEpoch(height), headlag)
if err != nil {