Merge pull request #1182 from zhy2006/master

fix:a bug of the power percentage in lotus-storage-miner info
This commit is contained in:
Łukasz Magiera 2020-01-30 08:18:49 +01:00 committed by GitHub
commit b42e481600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,8 +50,8 @@ var infoCmd = &cli.Command{
return err
}
percI := types.BigDiv(types.BigMul(pow.MinerPower, types.NewInt(1000)), pow.TotalPower)
fmt.Printf("Power: %s / %s (%0.4f%%)\n", pow.MinerPower.SizeStr(), pow.TotalPower.SizeStr(), float64(percI.Int64())/100000*10000)
percI := types.BigDiv(types.BigMul(pow.MinerPower, types.NewInt(1000000)), pow.TotalPower)
fmt.Printf("Power: %s / %s (%0.4f%%)\n", pow.MinerPower.SizeStr(), pow.TotalPower.SizeStr(), float64(percI.Int64())/10000)
secCounts, err := api.StateMinerSectorCount(ctx, maddr, nil)
if err != nil {