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

feat: use the guard pattern when fetching blocks. #154

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

ielashi
Copy link
Collaborator

@ielashi ielashi commented Mar 16, 2023

Problem

If for any reason the logic in fetching blocks panics, we'll forever stop fetching new blocks.

Solution

Use the guard pattern, which guarantees that we always set the is_fetching_blocks flag to false and continue fetching new blocks whenever we receive a response, even if it traps.

@ielashi ielashi marked this pull request as ready for review March 16, 2023 08:56
@ielashi ielashi requested a review from a team as a code owner March 16, 2023 08:56
@ielashi ielashi merged commit 0a1de40 into master Mar 17, 2023
@ielashi ielashi deleted the ielashi/guard_pattern branch March 17, 2023 14:38
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.

2 participants