-
Notifications
You must be signed in to change notification settings - Fork 38.7k
p2p: refactor: tidy up PeerManagerImpl::Misbehaving(...)
#22495
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
p2p: refactor: tidy up PeerManagerImpl::Misbehaving(...)
#22495
Conversation
lsilva01
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.
Code Review ACK 9459fe5
rajarshimaitra
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.
tACK 9459fe5
Agreed that the code looks cleaner than before.
Verified p2p_invalid_messages and p2p_filter test producing expected misbehavior.
- introduce constant variables `score_before` and `score_after` in order to improve readability - deduplicate calls to LogPrint(), eliminates else-branch
9459fe5 to
8858e88
Compare
|
Force-pushed with the suggestions by jnewbery (#22495 (comment), #22495 (comment)). Thanks to all reviewers so far! |
|
utACK 8858e88 |
rajarshimaitra
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.
tACK 8858e88
…ving(...)` 8858e88 p2p: refactor: tidy up `PeerManagerImpl::Misbehaving(...)` (Sebastian Falbesoner) Pull request description: This simple refactoring PR has the goal to improve the readability of the `Misbehaving` method by - introducing constant variables `score_before` and `score_now` (to avoid repeatedly calculating the former) - deduplicating calls to LogPrint(), eliminates else-branch ACKs for top commit: jnewbery: utACK 8858e88 rajarshimaitra: tACK bitcoin@8858e88 Tree-SHA512: 1d4dd5ac1d16ee9595edf4fa46e4960915a203641d74e6c33cffaba62ea71328834309a4451256fb45daf759f0cf6f4f199c46815afff6c89c0746e2ad4d4092
This simple refactoring PR has the goal to improve the readability of the
Misbehavingmethod byscore_beforeandscore_now(to avoid repeatedly calculating the former)