@@ -21,6 +21,8 @@ import (
21
21
_ "github.com/filecoin-project/lotus/build"
22
22
)
23
23
24
+ const LatestVersion = network .Version26
25
+
24
26
type ActorCidMap map [string ]cid.Cid
25
27
type BuiltinActorsMetadata struct {
26
28
Network string
@@ -134,8 +136,8 @@ func loadActorCids(currentNetworkVersion network.Version, loadAllActorVersions b
134
136
135
137
if loadAllActorVersions {
136
138
zap .S ().Info ("loading all actor versions" )
137
- networkVersions = make ([]network.Version , network . Version26 + 1 )
138
- for i := network .Version0 ; i <= network . Version26 ; i ++ {
139
+ networkVersions = make ([]network.Version , LatestVersion + 1 )
140
+ for i := network .Version0 ; i <= LatestVersion ; i ++ {
139
141
networkVersions [i ] = i
140
142
}
141
143
} else {
@@ -154,20 +156,19 @@ func loadActorCids(currentNetworkVersion network.Version, loadAllActorVersions b
154
156
actorCids , err := lotusApi .StateActorCodeCIDs (context .Background (), version )
155
157
if err != nil {
156
158
zap .S ().Errorf ("worker %d: error loading actor cids for version %d: %s" , i , version , err .Error ())
159
+ actorCids = ActorCidMap {}
157
160
}
158
161
actorCidsChannel <- map [network.Version ]ActorCidMap {version : actorCids }
159
162
}
160
163
}(i )
161
164
}
162
165
163
166
for _ , networkVersion := range networkVersions {
164
- fmt .Printf ("main: sending version %d to worker\n " , networkVersion )
165
167
versionChannel <- networkVersion
166
168
}
167
169
168
170
var received int
169
171
for actorCids := range actorCidsChannel {
170
- fmt .Printf ("received actor cids for version %d\n " , received + 1 )
171
172
for version , actors := range actorCids {
172
173
actorCidsMap [version ] = actors
173
174
}
0 commit comments