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

eth/downloader: fix rare crash when parent header missing in db #27945

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Aug 17, 2023

fix #27931

Signed-off-by: jsvisa <delweng@gmail.com>
eth/downloader/skeleton.go Outdated Show resolved Hide resolved
eth/downloader/skeleton.go Outdated Show resolved Hide resolved
Co-authored-by: Martin Holst Swende <martin@swende.se>
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@fjl fjl changed the title eth/downloader: check parent before use eth/downloader: fix rare crash when parent header missing in db Aug 17, 2023
@fjl fjl merged commit 649deb6 into ethereum:master Aug 17, 2023
1 of 2 checks passed
@fjl fjl added this to the 1.13.0 milestone Aug 17, 2023
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
…reum#27945)

ReadSkeletonHeader can return nil if the header is missing, so we should
not access fields on it. Note that calling .Hash() on a nil header is fine, so there 
is no need to actually check for nil.

Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
@jsvisa jsvisa deleted the eth-downloader-check-parent branch September 5, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not All ReadSkeletonHeader check the return value equals nil
3 participants