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

Fixed sync handling large forks #647

Merged
merged 1 commit into from
Mar 9, 2016
Merged

Fixed sync handling large forks #647

merged 1 commit into from
Mar 9, 2016

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Mar 9, 2016

Fixes a panic when syncing Morden chain, which is currently forked. Most peers are on the invalid chain

@@ -843,8 +843,8 @@ impl ChainSync {
self.downloading_bodies.remove(&n);
self.downloading_headers.remove(&n);
}
self.headers.remove_tail(&start);
self.bodies.remove_tail(&start);
self.headers.remove_from(&start);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All following blocks/headers must be removed since it is possible that on a forked chain a block body (same transaction/uncles) will belong to a block with a different number or hash, which will cause a block body-to header mismatch.

@arkpar arkpar added the A0-pleasereview 🤓 Pull request needs code review. label Mar 9, 2016
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 9, 2016
gavofyork pushed a commit that referenced this pull request Mar 9, 2016
Fixed sync handling large forks
@gavofyork gavofyork merged commit 2ecad23 into master Mar 9, 2016
@gavofyork gavofyork deleted the sync branch March 9, 2016 23:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants