aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2021-04-13 12:14:57 +0200
committerVasil Dimov <vd@FreeBSD.org>2021-12-01 15:22:59 +0100
commit6bf6e9fd9dece67878595a5f3361851c25833c49 (patch)
tree17570439873bd595c91a140f82004124153d524f /src/net.h
parent9e3cbfca7c9efa620c0cce73503772805cc1fa82 (diff)
downloadbitcoin-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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index bb6e7a79ad..13ebb6ac3a 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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);