Skip to content

Commit

Permalink
sectors expired: Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Aug 24, 2021
1 parent a9bf246 commit 5a23c2b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -1553,24 +1553,6 @@ var sectorsExpiredCmd = &cli.Command{
defer nCloser()
ctx := lcli.ReqContext(cctx)

maddr, err := nodeApi.ActorAddress(ctx)
if err != nil {
return xerrors.Errorf("getting actor address: %w", err)
}

// toCheck is a working bitfield which will only contain terminated sectors
toCheck := bitfield.New()
{
sectors, err := nodeApi.SectorsList(ctx)
if err != nil {
return xerrors.Errorf("getting sector list: %w", err)
}

for _, sector := range sectors {
toCheck.Set(uint64(sector))
}
}

head, err := fullApi.ChainHead(ctx)
if err != nil {
return xerrors.Errorf("getting chain head: %w", err)
Expand Down Expand Up @@ -1598,6 +1580,24 @@ var sectorsExpiredCmd = &cli.Command{
return xerrors.Errorf("getting lookback tipset: %w", err)
}

maddr, err := nodeApi.ActorAddress(ctx)
if err != nil {
return xerrors.Errorf("getting actor address: %w", err)
}

// toCheck is a working bitfield which will only contain terminated sectors
toCheck := bitfield.New()
{
sectors, err := nodeApi.SectorsList(ctx)
if err != nil {
return xerrors.Errorf("getting sector list: %w", err)
}

for _, sector := range sectors {
toCheck.Set(uint64(sector))
}
}

mact, err := fullApi.StateGetActor(ctx, maddr, lbts.Key())
if err != nil {
return err
Expand Down

0 comments on commit 5a23c2b

Please sign in to comment.