Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 2,745 Lines • ▼ Show 20 Lines | |||||
CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, | CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, | ||||
int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, | int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, | ||||
uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, | uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, | ||||
const CAddress &addrBindIn, const std::string &addrNameIn, | const CAddress &addrBindIn, const std::string &addrNameIn, | ||||
bool fInboundIn, bool block_relay_only) | bool fInboundIn, bool block_relay_only) | ||||
: nTimeConnected(GetSystemTimeInSeconds()), addr(addrIn), | : nTimeConnected(GetSystemTimeInSeconds()), addr(addrIn), | ||||
addrBind(addrBindIn), fInbound(fInboundIn), | addrBind(addrBindIn), fInbound(fInboundIn), | ||||
nKeyedNetGroup(nKeyedNetGroupIn), addrKnown(5000, 0.001), id(idIn), | nKeyedNetGroup(nKeyedNetGroupIn), addrKnown(5000, 0.001), | ||||
// Don't relay addr messages to peers that we connect to as | |||||
// block-relay-only peers (to prevent adversaries from inferring these | |||||
// links from addr traffic). | |||||
m_addr_relay_peer(!block_relay_only), id(idIn), | |||||
nLocalHostNonce(nLocalHostNonceIn), nLocalServices(nLocalServicesIn), | nLocalHostNonce(nLocalHostNonceIn), nLocalServices(nLocalServicesIn), | ||||
nMyStartingHeight(nMyStartingHeightIn) { | nMyStartingHeight(nMyStartingHeightIn) { | ||||
hSocket = hSocketIn; | hSocket = hSocketIn; | ||||
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; | addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; | ||||
hashContinue = BlockHash(); | hashContinue = BlockHash(); | ||||
if (!block_relay_only) { | if (!block_relay_only) { | ||||
m_tx_relay = std::make_unique<TxRelay>(); | m_tx_relay = std::make_unique<TxRelay>(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |