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

Bugfix: sync stuck 33 #266

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Bugfix: sync stuck 33 #266

merged 2 commits into from
Dec 13, 2024

Conversation

HashEngineering
Copy link
Collaborator

@HashEngineering HashEngineering commented Dec 11, 2024

Issue being fixed or feature implemented

Use longer chain file.

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@HashEngineering HashEngineering self-assigned this Dec 11, 2024
Comment on lines +73 to +76
private AbstractBlockChain getLongestChain() {
return headersChain != null && headersChain.getBestChainHeight() > blockChain.getBestChainHeight() ?
headersChain : blockChain;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change, which uses the longer of the two chains, allowed for syncing to get a bit further when there was anuse with a thread freezing on Android:

  1. headers - only used to sync headers
  2. blocks - used to sync blocks and transactions

This change only delayed when the freeze happened, but this way, there is a consistant approach.

Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

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

Looks good

@HashEngineering HashEngineering merged commit 7e0aab3 into master Dec 13, 2024
4 of 5 checks passed
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