Construct a peer connection with the given identity, socket, addresses and options.

Synopsis

Declared in <net.h>

CNode(
    NodeId id,
    std::shared_ptr<Sock> sock,
    CAddress const& addrIn,
    uint64_t nKeyedNetGroupIn,
    uint64_t nLocalHostNonceIn,
    CService const& addrBindIn,
    std::string const& addrNameIn,
    ConnectionType conn_type_in,
    bool inbound_onion,
    uint64_t network_key,
    CNodeOptions&& node_opts = {});

Parameters

Name

Description

id

the unique identifier for this peer.

sock

the connected socket used to communicate with the peer.

addrIn

the address of the peer.

nKeyedNetGroupIn

the network group key used to bucket this peer.

nLocalHostNonceIn

the local nonce used to detect connections to ourselves.

addrBindIn

the bind address of our side of the connection.

addrNameIn

the human‐readable address or hostname of the peer.

conn_type_in

the type of this connection.

inbound_onion

whether this is an inbound onion (Tor) connection.

network_key

the network key used to prevent cross‐network fingerprinting.

node_opts

additional per‐connection options.

Created with MrDocs