mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 02:33:28 +01:00
Merge #20811: refactor: move net_processing implementation details out of header
c97f70c861net_processing: move Peer definition to .cpp (Anthony Towns)e0f2e6d2dfnet_processing: move PeerManagerImpl into cpp file (Anthony Towns)a568b82febnet_processing: split PeerManager into interface and implementation classes (Anthony Towns)0df3d3fd6bnet_processing: make more of PeerManager private (Anthony Towns)0d246a59b6net, net_processing: move NetEventsInterface method docs to net.h (Anthony Towns) Pull request description: Moves the implementation details of `PeerManager` and all of `struct Peer` into net_processing.cpp. ACKs for top commit: jnewbery: ACKc97f70c861Sjors: ACKc97f70c861laanwj: Code review ACKc97f70c861vasild: ACKc97f70c861Tree-SHA512: 2e081e491d981c61bd78436a6a6c2eb41d3c2d86a1a8ef9d4d6f801b82cb64a8bf707a96db3429418d1704cffb60a657d1037a0336cbc8173fb79aef9eb72001
This commit is contained in:
23
src/net.h
23
src/net.h
@@ -760,11 +760,30 @@ private:
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user