-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[tests] Fixed intermittent failure in p2p_sendheaders.py. #13192
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
Conversation
Added handling for the case where headers are announced over more than one message. refs bitcoin#12453
|
Concept ACK |
jnewbery
left a comment
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.
Thanks for this contribution @lmanners. Looks great!
Tested ACK 12d1b77. I've run this 100 times locally and not been able to reproduce the error (although note that this was a timing error that was previously only seen on Travis).
A nit and a comment inline, but no need to update the branch for either of those. I think this can be merged as is.
| if len(message.headers): | ||
| self.block_announced = True | ||
| message.headers[-1].calc_sha256() | ||
| for x in message.headers: |
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.
nit: prefer header as variable name over x
|
|
||
| inv_node.check_last_announcement(inv=[tip_hash], headers=[]) | ||
| test_node.check_last_announcement(inv=[tip_hash], headers=[]) | ||
| inv_node.check_last_inv_announcement(inv=[tip_hash]) |
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.
Calling the method with a named argument isn't strictly necessary, since the method only takes a single argument now, but it does no harm.
|
utACK 12d1b77 |
12d1b77 [tests] Fixed intermittent failure in p2p_sendheaders.py. (lmanners) Pull request description: Added handling for the case where headers are announced over more than one message. refs #12453 Tree-SHA512: 2c5b48ff019089b86e358181ba170d3aac09d4ae41ec79c2718e0ee83705860501bbcb8fd94d0f5c4f86c0d54a96781a967716621bb8c5ecc991b39af3cec506
Added handling for the case where headers are announced over more than one message. refs bitcoin#12453 Github-Pull: bitcoin#13192 Rebased-From: 12d1b77
Added handling for the case where headers are announced over more than one message. refs bitcoin#12453 Github-Pull: bitcoin#13192 Rebased-From: 12d1b77
…aders.py. 12d1b77 [tests] Fixed intermittent failure in p2p_sendheaders.py. (lmanners) Pull request description: Added handling for the case where headers are announced over more than one message. refs bitcoin#12453 Tree-SHA512: 2c5b48ff019089b86e358181ba170d3aac09d4ae41ec79c2718e0ee83705860501bbcb8fd94d0f5c4f86c0d54a96781a967716621bb8c5ecc991b39af3cec506
Added handling for the case where headers are announced over more than one message.
refs #12453