Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
fix for issue #146; mark header checked for contract if it doesnt hav…
Browse files Browse the repository at this point in the history
…e any logs at that header but other contracts do
  • Loading branch information
i-norden committed Oct 11, 2019
1 parent 7be070f commit 7ed1432
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/contract_watcher/header/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,19 @@ func (tr *Transformer) Execute() error {

// Process logs for each contract
for conAddr, logs := range sortedLogs {
con := tr.Contracts[conAddr]
if logs == nil {
for eventName := range con.Events {
eventId := strings.ToLower(eventName + "_" + con.Address)
markCheckedErr := tr.HeaderRepository.MarkHeaderChecked(header.Id, eventId)
if markCheckedErr != nil {
return fmt.Errorf("error marking header checked: %s", markCheckedErr.Error())
}
}
logrus.Tracef("no logs found for contract %s at block %d, continuing", conAddr, header.BlockNumber)
continue
}
// Configure converter with this contract
con := tr.Contracts[conAddr]
tr.Converter.Update(con)

// Convert logs into batches of log mappings (eventName => []types.Logs
Expand Down

0 comments on commit 7ed1432

Please sign in to comment.