Skip to content

Commit 8db9941

Browse files
authored
fix UI sector list for expired sectors (#463)
1 parent 229ef74 commit 8db9941

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

web/api/sector/sector.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ func (c *cfg) getSectors(w http.ResponseWriter, r *http.Request) {
199199
}
200200
sectors[i].Proving = chainy.active
201201
if st.Expiration < head.Height() {
202-
sectors[i].Flag = true // Flag expired sectors
202+
delete(sectorIdx, sectorID{minerID, uint64(st.SectorNumber)})
203+
sectors = append(sectors[:i], sectors[i+1:]...)
204+
continue
203205
}
204206

205207
dw, vp := .0, .0
@@ -256,6 +258,9 @@ func (c *cfg) getSectors(w http.ResponseWriter, r *http.Request) {
256258
sectors[i].Deals = fmt.Sprintf("Market: %d, DDO: %d", f05, ddo)
257259
} else {
258260
// sector is on chain but not in db
261+
if st.Expiration < head.Height() {
262+
continue // skip expired ones
263+
}
259264
s := sector{
260265
MinerID: minerID,
261266
MinerAddress: maddr,
@@ -271,12 +276,6 @@ func (c *cfg) getSectors(w http.ResponseWriter, r *http.Request) {
271276
}
272277
sectors = append(sectors, s)
273278
}
274-
/*
275-
info, err := c.Full.StateSectorGetInfo(r.Context(), minerToAddr[s], abi.SectorNumber(uint64(sectors[i].SectorNum)), headKey)
276-
if err != nil {
277-
sectors[i].IsValid = false
278-
continue
279-
}*/
280279
}
281280
}
282281

0 commit comments

Comments
 (0)