diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-04-13 12:14:57 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-12-01 15:22:59 +0100 |
commit | 6bf6e9fd9dece67878595a5f3361851c25833c49 (patch) | |
tree | 17570439873bd595c91a140f82004124153d524f /src/net.h | |
parent | 9e3cbfca7c9efa620c0cce73503772805cc1fa82 (diff) | |
download | bitcoin-6bf6e9fd9dece67878595a5f3361851c25833c49.tar.xz |
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).
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |