Add back network power to stats

This commit is contained in:
Travis Person 2020-09-26 17:09:16 +00:00
parent 2c1d96bcaa
commit 1c5cb50da3

View File

@ -10,6 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/reward" "github.com/filecoin-project/lotus/chain/actors/builtin/reward"
@ -252,6 +253,14 @@ func RecordTipsetStatePoints(ctx context.Context, api api.FullNode, pl *PointLis
p := NewPoint("network.balance", netBalFilFloat) p := NewPoint("network.balance", netBalFilFloat)
pl.AddPoint(p) pl.AddPoint(p)
totalPower, err := api.StateMinerPower(ctx, address.Address{}, tipset.Key())
if err != nil {
return err
}
p = NewPoint("chain.power", totalPower.TotalPower.QualityAdjPower.Int64())
pl.AddPoint(p)
miners, err := api.StateListMiners(ctx, tipset.Key()) miners, err := api.StateListMiners(ctx, tipset.Key())
if err != nil { if err != nil {
return err return err