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
Bad tip expiration for pulling blocks fix #1614
Bad tip expiration for pulling blocks fix #1614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it needs to target to a maintenance branch instead of the main branch.
@@ -155,11 +155,11 @@ CancellationToken cancellationToken | |||
lastUpdated = DateTimeOffset.UtcNow; | |||
lastTip = BlockChain.Tip; | |||
} | |||
else if (lastUpdated + tipLifespan > DateTimeOffset.UtcNow) | |||
else if (lastUpdated + tipLifespan < DateTimeOffset.UtcNow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be difficult to add a regression test for this bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's probably possible to do a unit test by elevating the access level to internal
and directly calling the method, but I'm not sure about a regression test. 😗
6513a00
to
2800e02
Compare
2800e02
to
e051177
Compare
Inequality inside
Swarm<T>.PollBlocksAsync()
determining whether tip has become stale was set up to act oppositely to what was intended. This would've resulted in not polling properly once tip has actually gone stale unless tip is changed by a push from another node.Also, changed the polling interval to
60
seconds.