Skip to content

Commit 0d246a5

Browse files
committed
net, net_processing: move NetEventsInterface method docs to net.h
1 parent 9158d6f commit 0d246a5

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

src/net.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,11 +769,30 @@ class CNode
769769
class NetEventsInterface
770770
{
771771
public:
772-
virtual bool ProcessMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0;
773-
virtual bool SendMessages(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode->cs_sendProcessing) = 0;
772+
/** Initialize a peer (setup state, queue any initial messages) */
774773
virtual void InitializeNode(CNode* pnode) = 0;
774+
775+
/** Handle removal of a peer (clear state) */
775776
virtual void FinalizeNode(const CNode& node, bool& update_connection_time) = 0;
776777

778+
/**
779+
* Process protocol messages received from a given node
780+
*
781+
* @param[in] pnode The node which we have received messages from.
782+
* @param[in] interrupt Interrupt condition for processing threads
783+
* @return True if there is more work to be done
784+
*/
785+
virtual bool ProcessMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0;
786+
787+
/**
788+
* Send queued protocol messages to a given node.
789+
*
790+
* @param[in] pnode The node which we are sending messages to.
791+
* @return True if there is more work to be done
792+
*/
793+
virtual bool SendMessages(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode->cs_sendProcessing) = 0;
794+
795+
777796
protected:
778797
/**
779798
* Protected destructor so that instances can only be deleted by derived classes.

src/net_processing.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,9 @@ class PeerManager final : public CValidationInterface, public NetEventsInterface
118118
*/
119119
void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override;
120120

121-
/** Initialize a peer by adding it to mapNodeState and pushing a message requesting its version */
122121
void InitializeNode(CNode* pnode) override;
123-
/** Handle removal of a peer by updating various state and removing it from mapNodeState */
124122
void FinalizeNode(const CNode& node, bool& fUpdateConnectionTime) override;
125-
/**
126-
* Process protocol messages received from a given node
127-
*
128-
* @param[in] pfrom The node which we have received messages from.
129-
* @param[in] interrupt Interrupt condition for processing threads
130-
*/
131123
bool ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt) override;
132-
/**
133-
* Send queued protocol messages to be sent to a give node.
134-
*
135-
* @param[in] pto The node which we are sending messages to.
136-
* @return True if there is more work to be done
137-
*/
138124
bool SendMessages(CNode* pto) override EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing);
139125

140126
/** Consider evicting an outbound peer based on the amount of time they've been behind our tip */

0 commit comments

Comments
 (0)