CNode::CNode

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

NameDescription
idthe unique identifier for this peer.
sockthe connected socket used to communicate with the peer.
addrInthe address of the peer.
nKeyedNetGroupInthe network group key used to bucket this peer.
nLocalHostNonceInthe local nonce used to detect connections to ourselves.
addrBindInthe bind address of our side of the connection.
addrNameInthe human-readable address or hostname of the peer.
conn_type_inthe type of this connection.
inbound_onionwhether this is an inbound onion (Tor) connection.
network_keythe network key used to prevent cross-network fingerprinting.
node_optsadditional per-connection options.