Skip to content

Commit

Permalink
Merge pull request #2781 from gobitfly/NOBIDS/IgnoreAllCouldNotResolv…
Browse files Browse the repository at this point in the history
…eNameErrors

(NOBIDS) ignore all could not resolve name errors
  • Loading branch information
recy21 authored Dec 20, 2023
2 parents ec81ba9 + a0e440f commit 71f860d
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions db/ens.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,21 @@ func validateEnsName(client *ethclient.Client, name string, alreadyChecked *EnsC

addr, err := go_ens.Resolve(client, name)
if err != nil {
if err.Error() == "unregistered name" ||
err.Error() == "no address" ||
err.Error() == "no resolver" ||
err.Error() == "abi: attempting to unmarshall an empty string while arguments are expected" ||
strings.Contains(err.Error(), "execution reverted") ||
err.Error() == "invalid jump destination" {
// the given name is not available anymore or resolving it did not work properly => we can remove it from the db (if it is there)
err = removeEnsName(client, name)
if err != nil {
return fmt.Errorf("error removing ens name [%v]: %w", name, err)
}

return nil
utils.LogError(err, "error, could not resolve name", 0, map[string]interface{}{"name": name})
/* if err.Error() == "unregistered name" ||
err.Error() == "no address" ||
err.Error() == "no resolver" ||
err.Error() == "abi: attempting to unmarshall an empty string while arguments are expected" ||
strings.Contains(err.Error(), "execution reverted") ||
err.Error() == "invalid jump destination" { */
// the given name is not available anymore or resolving it did not work properly => we can remove it from the db (if it is there)
err = removeEnsName(client, name)
if err != nil {
return fmt.Errorf("error removing ens name [%v]: %w", name, err)
}

return fmt.Errorf("error could not resolve name [%v]: %w", name, err)
return nil
// }
// return fmt.Errorf("error could not resolve name [%v]: %w", name, err)
}

// we need to get the main domain to get the expiration date
Expand Down

0 comments on commit 71f860d

Please sign in to comment.