@@ -34,9 +34,14 @@ func (SectorEventsExtractor) Extract(ctx context.Context, a actorstate.ActorInfo
34
34
}
35
35
36
36
var (
37
- sectorChanges * miner.SectorChanges
38
- preCommitChanges * miner.PreCommitChanges
39
- sectorStateChanges * SectorStateEvents
37
+ sectorChanges = miner .MakeSectorChanges ()
38
+ preCommitChanges = miner .MakePreCommitChanges ()
39
+ sectorStateChanges = & SectorStateEvents {
40
+ Removed : bitfield .New (),
41
+ Recovering : bitfield .New (),
42
+ Faulted : bitfield .New (),
43
+ Recovered : bitfield .New (),
44
+ }
40
45
)
41
46
if extState .ParentState () == nil {
42
47
// If the miner doesn't have previous state list all of its current sectors and precommits
@@ -45,12 +50,10 @@ func (SectorEventsExtractor) Extract(ctx context.Context, a actorstate.ActorInfo
45
50
return nil , fmt .Errorf ("loading miner sectors: %w" , err )
46
51
}
47
52
48
- sectorChanges = miner .MakeSectorChanges ()
49
53
for _ , sector := range sectors {
50
54
sectorChanges .Added = append (sectorChanges .Added , * sector )
51
55
}
52
56
53
- preCommitChanges = miner .MakePreCommitChanges ()
54
57
if err = extState .CurrentState ().ForEachPrecommittedSector (func (info minertypes.SectorPreCommitOnChainInfo ) error {
55
58
preCommitChanges .Added = append (preCommitChanges .Added , info )
56
59
return nil
0 commit comments