Skip to content

Commit

Permalink
removing annoying logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Jun 5, 2024
1 parent cf7c29d commit b6b42c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scanner/providers/web3/erc20_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func (p *ERC20HolderProvider) HoldersBalances(ctx context.Context, _ []byte, fro
// encode the number of new transfers
newTransfers := uint64(0)
balances := make(map[common.Address]*big.Int)
alreadyProcessedLogs := 0
// iterate the logs and update the balances
for _, currentLog := range logs {
// check if the log has been already processed
Expand All @@ -168,10 +169,9 @@ func (p *ERC20HolderProvider) HoldersBalances(ctx context.Context, _ []byte, fro
errors.Join(ErrCheckingProcessedLogs, fmt.Errorf("[ERC20] %s: %w", p.address, err))
}
if processed {
log.Info("log already processed")
alreadyProcessedLogs++
continue
}
log.Info("log not processed yet, processing...")
newTransfers++
logData, err := p.contract.ERC20ContractFilterer.ParseTransfer(currentLog)
if err != nil {
Expand All @@ -192,7 +192,8 @@ func (p *ERC20HolderProvider) HoldersBalances(ctx context.Context, _ []byte, fro
}
log.Infow("saving blocks",
"count", len(balances),
"logs", len(logs),
"new_logs", newTransfers,
"already_processed_logs", alreadyProcessedLogs,
"blocks/s", 1000*float32(lastBlock-fromBlock)/float32(time.Since(startTime).Milliseconds()),
"took", time.Since(startTime).Seconds(),
"progress", fmt.Sprintf("%d%%", (fromBlock*100)/toBlock))
Expand Down

0 comments on commit b6b42c7

Please sign in to comment.