Skip to content

Commit

Permalink
Only count the first 10 copies of the same piece per project
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Dec 3, 2020
1 parent ca51457 commit 7a28712
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/lotus-shed/sr2-dealstats-rollup.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ var rollupDealStatsCmd = &cli.Command{
}

grandTotals.seenProject[projID] = true
grandTotals.seenClient[clientAddr] = true

projStatEntry, ok := projStats[projID]
if !ok {
projStatEntry = &projectAggregateStats{
Expand All @@ -294,6 +292,11 @@ var rollupDealStatsCmd = &cli.Command{
projStats[projID] = projStatEntry
}

if projStatEntry.cidDeals[dealInfo.Proposal.PieceCID] >= 10 {
continue
}

grandTotals.seenClient[clientAddr] = true
clientStatEntry, ok := projStatEntry.ClientStats[clientAddr.String()]
if !ok {
clientStatEntry = &clientAggregateStats{
Expand Down

0 comments on commit 7a28712

Please sign in to comment.