Skip to content

Commit 824bbd1

Browse files
committed
[move only] Collect all private members of PeerLogicValidation together
We don't have a project style for ordering class members, but it always makes sense to have no more than one of each public/protected/private specifier. Also move documentation for MaybeDiscourageAndDisconnect to the header.
1 parent 0708705 commit 824bbd1

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/net_processing.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,11 +3795,6 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
37953795
return;
37963796
}
37973797

3798-
/** Maybe disconnect a peer and discourage future connections from its address.
3799-
*
3800-
* @param[in] pnode The node to check.
3801-
* @return True if the peer was marked for disconnection in this function
3802-
*/
38033798
bool PeerLogicValidation::MaybeDiscourageAndDisconnect(CNode& pnode)
38043799
{
38053800
const NodeId peer_id{pnode.GetId()};

src/net_processing.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ static const bool DEFAULT_PEERBLOCKFILTERS = false;
2828
static const int DISCOURAGEMENT_THRESHOLD{100};
2929

3030
class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface {
31-
private:
32-
CConnman& m_connman;
33-
/** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */
34-
BanMan* const m_banman;
35-
ChainstateManager& m_chainman;
36-
CTxMemPool& m_mempool;
37-
38-
bool MaybeDiscourageAndDisconnect(CNode& pnode);
39-
4031
public:
4132
PeerLogicValidation(CConnman& connman, BanMan* banman, CScheduler& scheduler, ChainstateManager& chainman, CTxMemPool& pool);
4233

@@ -92,8 +83,20 @@ class PeerLogicValidation final : public CValidationInterface, public NetEventsI
9283
const std::atomic<bool>& interruptMsgProc);
9384

9485
private:
95-
int64_t m_stale_tip_check_time; //!< Next time to check for stale tip
86+
/** Maybe disconnect a peer and discourage future connections from its address.
87+
*
88+
* @param[in] pnode The node to check.
89+
* @return True if the peer was marked for disconnection in this function
90+
*/
91+
bool MaybeDiscourageAndDisconnect(CNode& pnode);
9692

93+
CConnman& m_connman;
94+
/** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */
95+
BanMan* const m_banman;
96+
ChainstateManager& m_chainman;
97+
CTxMemPool& m_mempool;
98+
99+
int64_t m_stale_tip_check_time; //!< Next time to check for stale tip
97100
};
98101

99102
struct CNodeStateStats {

0 commit comments

Comments
 (0)