diff options
author | MacroFake <falke.marco@gmail.com> | 2022-06-27 11:20:47 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-27 11:21:08 +0200 |
commit | 50a3921c96bf0336760d836b24ce23563a752bac (patch) | |
tree | 8b6a3b69ae8aa4fc9dc67a57d0b367ed0c663f5a /src/merkleblock.cpp | |
parent | fffff0abb9c71f0af83a7925db3c293b3bb12158 (diff) | |
parent | fa8aa0aa8180c3a0369c7589b8747666778a0deb (diff) |
Merge bitcoin/bitcoin#25144: refactor: Pass Peer& to Misbehaving()
fa8aa0aa8180c3a0369c7589b8747666778a0deb Pass Peer& to Misbehaving() (MacroFake)
Pull request description:
`Misbehaving` has several coding related issues (ignoring the conceptual issues here for now):
* It is public, but it is not supposed to be called from outside of net_processing. Fix that by making it private and creating a public `UnitTestMisbehaving` method for unit testing only.
* It doesn't do anything if a `nullptr` is passed. It would be less confusing to just skip the call instead. Fix that by passing `Peer&` to `Misbehaving()`.
* It calls `GetPeerRef`, causing `!m_peer_mutex` lock annotations to be propagated. This is harmless, but verbose. Fix it by removing the no longer needed call to `GetPeerRef` and the no longer needed lock annotations.
ACKs for top commit:
vasild:
ACK fa8aa0aa8180c3a0369c7589b8747666778a0deb
w0xlt:
Code Review ACK https://github.com/bitcoin/bitcoin/pull/25144/commits/fa8aa0aa8180c3a0369c7589b8747666778a0deb
Tree-SHA512: e60a6b317f2b826f9e0724285d00b632d3e2a91ded9fa5ba01c80766c5d39270b719be234c01302d46eaba600910032693836aa116ff05ee1b590c7530881cd3
Diffstat (limited to 'src/merkleblock.cpp')
0 files changed, 0 insertions, 0 deletions