Add filtering of addresses associated with miners
This commit is contained in:
parent
10cdbadd82
commit
1483f1e59a
@ -201,6 +201,26 @@ func (dss *dealStatsServer) filteredDealList() (int64, map[string]dealInfo) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// Exclude any address associated with a miner
|
||||
miners, err := dss.api.StateListMiners(ctx, head.Key())
|
||||
if err != nil {
|
||||
log.Warnf("failed to get miner list: %s", err)
|
||||
return 0, nil
|
||||
}
|
||||
for _, m := range miners {
|
||||
info, err := dss.api.StateMinerInfo(ctx, m, head.Key())
|
||||
if err != nil {
|
||||
log.Warnf("failed to get info for known miner '%s': %s", m, err)
|
||||
continue
|
||||
}
|
||||
|
||||
knownFiltered.Store(info.Owner, true)
|
||||
knownFiltered.Store(info.Worker, true)
|
||||
for _, a := range info.ControlAddresses {
|
||||
knownFiltered.Store(a, true)
|
||||
}
|
||||
}
|
||||
|
||||
deals, err := dss.api.StateMarketDeals(ctx, head.Key())
|
||||
if err != nil {
|
||||
log.Warnf("failed to get market deals: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user