-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Simplify ProcessGetBlockData execution by removing send flag #13670
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
Simplify ProcessGetBlockData execution by removing send flag #13670
Conversation
|
Concept ACK |
promag
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.
Concept ACK, simplification is correct. Not sure about the new test.
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.
Remove, it's unnecessary.
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.
Specify:
from test_framework.mininode import (CInv, P2PInterface, msg_getdata)|
utACK 4677dc25d4fa3183e745d2b2f995809845148cc8. Didn't review the test. |
4677dc2 to
093ea05
Compare
|
I think it is somewhat subjective whether an early return is preferable to a status variable. ACK on the test in any case. |
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.
Doesn't seem like this subclass is necessary. Any reason you can't just use P2PInterface on line 23 below?
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.
Agree. (Sorry, my previous comment didn't apply, thus deleted)
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 @jamesob. Test has been updated.
093ea05 to
077df8e
Compare
| No more conflicts as of last run. |
sipa
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.
Concept ACK
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.
What is this testing? I don't see any assertions.
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.
I think an earlier version of the code would crash when receiving such an inv. But yeah, somewhat agree that a new test file with all the overhead is a bit too much for testing so little
Setting the send flag to false can be replaced by simply returning.
077df8e to
0cf546f
Compare
|
I've just dropped the test entirely here. |
|
utACK 0cf546f ...
... as long as these horrible single line if statements with multiple
nested parens are cleaned up soon after
|
trongham
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.
Reviee
…ata, remove send bool fa81773 style-only: Remove whitespace (MarcoFalke) fae77b9 net: Simplify ProcessGetBlockData execution by removing send flag. (Patrick Strateman) fae7c04 log: Clarify that block request below NODE_NETWORK_LIMITED_MIN_BLOCKS disconnects (MarcoFalke) Pull request description: * Clarify that "ignoring" really means "disconnect" in the log * Revive a refactor I took from #13670 ACKs for top commit: jnewbery: utACK fa81773 sipa: utACK fa81773 Tree-SHA512: 0a4fcb979cb82c4e26012881eeaf903c38dfbb85d461476c01e35294760744746a79c48ffad827fe31c1b830f40c6e4240529c71e375146e4d0313c3b7d784ca
Rebased/nits fixed version of #13250.