Skip to content

Commit

Permalink
Count deals from sealed sectors only
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Dec 3, 2020
1 parent 7a28712 commit 610e783
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/lotus-shed/sr2-dealstats-rollup.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,13 @@ var rollupDealStatsCmd = &cli.Command{

for dealID, dealInfo := range deals {

// Counting no-longer-active deals as per Pooja's request
// // https://github.com/filecoin-project/specs-actors/blob/v0.9.9/actors/builtin/market/deal.go#L81-L85
// if d.State.SectorStartEpoch < 0 {
// continue
// }
// Only count deals that have properly started, not past/future ones
// https://github.com/filecoin-project/specs-actors/blob/v0.9.9/actors/builtin/market/deal.go#L81-L85
// Bail on 0 as well in case SectorStartEpoch is uninitialized due to some bug
if dealInfo.State.SectorStartEpoch <= 0 ||
dealInfo.State.SectorStartEpoch > head.Height() {
continue
}

clientAddr, found := resolvedWallets[dealInfo.Proposal.Client]
if !found {
Expand Down

0 comments on commit 610e783

Please sign in to comment.