sealing: numassign: take on-chain allocated numbers into account
This commit is contained in:
@@ -880,6 +880,18 @@ func (a *StateAPI) StateMinerSectorCount(ctx context.Context, addr address.Addre
|
||||
return api.MinerSectors{Live: liveCount, Active: activeCount, Faulty: faultyCount}, nil
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateMinerAllocated(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*bitfield.BitField, error) {
|
||||
act, err := a.StateManager.LoadActorTsk(ctx, addr, tsk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mas, err := miner.Load(a.Chain.ActorStore(ctx), act)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mas.GetAllocatedSectors()
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user