Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: catch eth error #2844

Merged
merged 1 commit into from
Mar 15, 2022
Merged

fix: catch eth error #2844

merged 1 commit into from
Mar 15, 2022

Conversation

notanatol
Copy link
Contributor

@notanatol notanatol commented Mar 15, 2022

Checklist

Description

we get inconsistent behavior when checking for synced status, this change will discriminate ethereum errors


This change is Reviewable

@mrekucci mrekucci requested a review from ralph-pichler March 15, 2022 17:44
Copy link
Contributor

@mrekucci mrekucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @mrekucci and @ralph-pichler)


pkg/transaction/backend.go, line 53 at r1 (raw file):

Previously, notanatol (Anatol) wrote…

extracted the check to reduce nesting

Another way could be:

if errors.Is(err, ethereum.NotFound) {
    err = nil
}
return false, time.Time{}, err

@mrekucci mrekucci self-requested a review March 15, 2022 17:44
@notanatol notanatol merged commit 447d24d into master Mar 15, 2022
@notanatol notanatol deleted the synced-err branch March 15, 2022 20:23
@aloknerurkar aloknerurkar added this to the 1.5.0 milestone Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants