Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Iterator should return without errors if no more blocks #64

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Aug 28, 2018

Propagating errors in iterator has caused an issue that I unfortunately hadn't foreseen. I'm sorry about this.

It tries to get the next blocks, and when the next block doesn't exist, it returns the NotFoundError upstream, which shouldn't be the case. I tried to fix this with minimal change , however please let me know if you want it fixed in another way.

Furthermore the PR modifies the test case checking for iterating an empty blockchain to check for errors in callback.

Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.938% when pulling 083b617 on s1na:fix/iterator-err-handling into 8100e62 on ethereumjs:master.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Tested this locally on a local geth install, works. Wondered if this could be written in a bit more elegant way, but I don't want to spend too much more back-and-forth on this, so I will merge for now.

Will directly do a bugfix release afterwards.

@holgerd77 holgerd77 merged commit b8f3ed8 into ethereumjs:master Aug 29, 2018
@s1na s1na deleted the fix/iterator-err-handling branch August 29, 2018 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants