chainwatch: Fix getting miner info

This commit is contained in:
Łukasz Magiera 2020-07-01 13:50:50 +02:00
parent 4c422c2d50
commit a359df93c9

View File

@ -61,7 +61,7 @@ type minerStateInfo struct {
// miner specific // miner specific
state miner.State state miner.State
info miner.MinerInfo info *miner.MinerInfo
// tracked by power actor // tracked by power actor
rawPower big.Int rawPower big.Int
@ -315,7 +315,7 @@ func syncHead(ctx context.Context, api api.FullNode, st *storage, headTs *types.
stateroot: c.stateroot, stateroot: c.stateroot,
state: miner.State{}, state: miner.State{},
info: miner.MinerInfo{}, info: nil,
rawPower: big.Zero(), rawPower: big.Zero(),
qalPower: big.Zero(), qalPower: big.Zero(),
@ -362,7 +362,11 @@ func syncHead(ctx context.Context, api api.FullNode, st *storage, headTs *types.
log.Error(err) log.Error(err)
return return
} }
mi.info = mi.state.Info mi.info, err = mi.state.GetInfo(&apiIpldStore{ctx, api})
if err != nil {
log.Error(err)
return
}
} }
// TODO Get the Sector Count // TODO Get the Sector Count