aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-01-07 12:27:22 +1000
committerAnthony Towns <aj@erisian.com.au>2021-01-09 23:27:45 +1000
commit0d246a59b606c51728d10cb70004a6eedb951bca (patch)
tree0400ab70ade009473022283d994d7b1e4b1edfb5 /src/net.h
parent9158d6f34153dc937e109d0e7486e956a26f20aa (diff)
downloadbitcoin-0d246a59b606c51728d10cb70004a6eedb951bca.tar.xz
net, net_processing: move NetEventsInterface method docs to net.h
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 0fe9b75790..63214e062b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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.