diff options
author | Anthony Towns <aj@erisian.com.au> | 2021-01-07 12:27:22 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2021-01-09 23:27:45 +1000 |
commit | 0d246a59b606c51728d10cb70004a6eedb951bca (patch) | |
tree | 0400ab70ade009473022283d994d7b1e4b1edfb5 /src | |
parent | 9158d6f34153dc937e109d0e7486e956a26f20aa (diff) |
net, net_processing: move NetEventsInterface method docs to net.h
Diffstat (limited to 'src')
-rw-r--r-- | src/net.h | 23 | ||||
-rw-r--r-- | src/net_processing.h | 14 |
2 files changed, 21 insertions, 16 deletions
@@ -769,11 +769,30 @@ public: class NetEventsInterface { public: - virtual bool ProcessMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0; - virtual bool SendMessages(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode->cs_sendProcessing) = 0; + /** Initialize a peer (setup state, queue any initial messages) */ virtual void InitializeNode(CNode* pnode) = 0; + + /** Handle removal of a peer (clear state) */ virtual void FinalizeNode(const CNode& node, bool& update_connection_time) = 0; + /** + * Process protocol messages received from a given node + * + * @param[in] pnode The node which we have received messages from. + * @param[in] interrupt Interrupt condition for processing threads + * @return True if there is more work to be done + */ + virtual bool ProcessMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0; + + /** + * Send queued protocol messages to a given node. + * + * @param[in] pnode The node which we are sending messages to. + * @return True if there is more work to be done + */ + virtual bool SendMessages(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode->cs_sendProcessing) = 0; + + protected: /** * Protected destructor so that instances can only be deleted by derived classes. diff --git a/src/net_processing.h b/src/net_processing.h index 322fabbe11..076dce1713 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -118,23 +118,9 @@ public: */ void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override; - /** Initialize a peer by adding it to mapNodeState and pushing a message requesting its version */ void InitializeNode(CNode* pnode) override; - /** Handle removal of a peer by updating various state and removing it from mapNodeState */ void FinalizeNode(const CNode& node, bool& fUpdateConnectionTime) override; - /** - * Process protocol messages received from a given node - * - * @param[in] pfrom The node which we have received messages from. - * @param[in] interrupt Interrupt condition for processing threads - */ bool ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt) override; - /** - * Send queued protocol messages to be sent to a give node. - * - * @param[in] pto The node which we are sending messages to. - * @return True if there is more work to be done - */ bool SendMessages(CNode* pto) override EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing); /** Consider evicting an outbound peer based on the amount of time they've been behind our tip */ |