mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
net: change CreateNodeFromAcceptedSocket() to take Sock
Change `CConnman::CreateNodeFromAcceptedSocket()` to take a `Sock` argument instead of `SOCKET`. This makes the method mockable and also a little bit shorter as some `CloseSocket()` calls are removed (the socket will be closed automatically by the `Sock` destructor on early return).
This commit is contained in:
@@ -974,12 +974,12 @@ private:
|
||||
/**
|
||||
* Create a `CNode` object from a socket that has just been accepted and add the node to
|
||||
* the `m_nodes` member.
|
||||
* @param[in] hSocket Connected socket to communicate with the peer.
|
||||
* @param[in] sock Connected socket to communicate with the peer.
|
||||
* @param[in] permissionFlags The peer's permissions.
|
||||
* @param[in] addr_bind The address and port at our side of the connection.
|
||||
* @param[in] addr The address and port at the peer's side of the connection.
|
||||
*/
|
||||
void CreateNodeFromAcceptedSocket(SOCKET hSocket,
|
||||
void CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
|
||||
NetPermissionFlags permissionFlags,
|
||||
const CAddress& addr_bind,
|
||||
const CAddress& addr);
|
||||
|
||||
Reference in New Issue
Block a user