storageminer: Don't print PP in info cmd if not proving

This commit is contained in:
Łukasz Magiera 2019-11-09 13:11:46 +01:00
parent 4e6e83149a
commit b8e18ed773

View File

@ -64,13 +64,18 @@ var infoCmd = &cli.Command{
if err != nil {
return err
}
head, err := api.ChainHead(ctx)
if err != nil {
return err
if ppe != 0 {
head, err := api.ChainHead(ctx)
if err != nil {
return err
}
pdiff := int64(ppe - head.Height())
pdifft := pdiff * build.BlockDelay
fmt.Printf("Proving Period: %d, in %d Blocks (~%dm %ds)\n", ppe, pdiff, pdifft/60, pdifft%60)
} else {
fmt.Printf("Proving Period: Not Proving\n")
}
pdiff := int64(ppe-head.Height())
pdifft := pdiff * build.BlockDelay
fmt.Printf("Proving Period: %d, in %d Blocks (~%dm %ds)\n", ppe, pdiff, pdifft / 60, pdifft % 60)
sinfo, err := sectorsInfo(ctx, nodeApi)
if err != nil {