-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
test: make sure non-IP peers get discouraged and disconnected (vasild) #21571
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
ACK 3d5eac6
A few optional suggestions follow.
This is a non-functional change that replaces the `CNode` on-stack variables with `CNode` pointers. The reason for this is that it would allow us to add those `CNode`s to `CConnman::vNodes[]` which in turn would allow us to check that they are disconnected properly - a `CNode` object must be in `CConnman::vNodes[]` in order for its `fDisconnect` flag to be set. If we store pointers to the on-stack variables in `CConnman` then it would crash at the end, trying to `delete` them.
Use `CConnmanTest` instead of `CConnman` and add the nodes to it so that their `fDisconnect` flag is set during disconnection.
3d5eac6
to
81747b2
Compare
ACK 81747b2 |
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.
This is a non-functional change that replaces the `CNode` on-stack variables with `CNode` pointers. The reason for this is that it would allow us to add those `CNode`s to `CConnman::vNodes[]` which in turn would allow us to check that they are disconnected properly - a `CNode` object must be in `CConnman::vNodes[]` in order for its `fDisconnect` flag to be set. If we store pointers to the on-stack variables in `CConnman` then it would crash at the end, trying to `delete` them. Github-Pull: bitcoin#21571 Rebased-From: 4d6e246
Use `CConnmanTest` instead of `CConnman` and add the nodes to it so that their `fDisconnect` flag is set during disconnection. Github-Pull: bitcoin#21571 Rebased-From: 637bb6d
Github-Pull: bitcoin#21571 Rebased-From: 81747b2
Backported in #21614 |
… disconnected (vasild) 81747b2 test: make sure non-IP peers get discouraged and disconnected (Vasil Dimov) 637bb6d test: also check disconnect in denialofservice_tests/peer_discouragement (Vasil Dimov) 4d6e246 test: use pointers in denialofservice_tests/peer_discouragement (Vasil Dimov) Pull request description: Split up from bitcoin#20966, so that it can be backported easier. Merging this ahead of bitcoin#20966 will also reduce the number of conflicts for that pull. ACKs for top commit: jonatack: ACK 81747b2 Tree-SHA512: 8f0e30b95baba7f056920d7fc3b37bd49ee13e69392fe80e2d333c6bb09fd25f4603249301b8795cca26a2f2d15b9f8904798a55cd9c04fd28afb316e95c551c
This is a non-functional change that replaces the `CNode` on-stack variables with `CNode` pointers. The reason for this is that it would allow us to add those `CNode`s to `CConnman::vNodes[]` which in turn would allow us to check that they are disconnected properly - a `CNode` object must be in `CConnman::vNodes[]` in order for its `fDisconnect` flag to be set. If we store pointers to the on-stack variables in `CConnman` then it would crash at the end, trying to `delete` them. Github-Pull: bitcoin#21571 Rebased-From: 4d6e246
Use `CConnmanTest` instead of `CConnman` and add the nodes to it so that their `fDisconnect` flag is set during disconnection. Github-Pull: bitcoin#21571 Rebased-From: 637bb6d
Github-Pull: bitcoin#21571 Rebased-From: 81747b2
Split up from #20966, so that it can be backported easier. Merging this ahead of #20966 will also reduce the number of conflicts for that pull.