Skip to content

core: fixed unwinding bad hash#3347

Merged
obscuren merged 1 commit intoethereum:masterfrom
obscuren:unwind-fix
Nov 28, 2016
Merged

core: fixed unwinding bad hash#3347
obscuren merged 1 commit intoethereum:masterfrom
obscuren:unwind-fix

Conversation

@obscuren
Copy link
Copy Markdown
Contributor

Fixed unwinding of bad hashes when already on the canon chain

@obscuren obscuren added this to the 1.5.4 milestone Nov 25, 2016
@mention-bot
Copy link
Copy Markdown

@obscuren, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zsfelfoldi, @karalabe and @fjl to be potential reviewers.

@obscuren obscuren force-pushed the unwind-fix branch 3 times, most recently from 7ee324e to 52d3a36 Compare November 26, 2016 10:17
Comment thread core/blockchain.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This check should be either of:

  • if headerByNumber != nil && headerByNumber.Hash() == header.Hash() { rewind }
  • if headerByNumber == nil || headerByNumber.Hash() != header.Hash() { continue } rewind

Although in theory the current implementation should also work, the conditions are imho not the cleanest combo :)

Fixed unwinding of bad hashes when already on the canon chain
@obscuren obscuren merged commit 801a13f into ethereum:master Nov 28, 2016
@obscuren obscuren deleted the unwind-fix branch November 28, 2016 09:37
zzzckck added a commit to zzzckck/go-ethereum that referenced this pull request Sep 10, 2025
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants