Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 2,883 Lines • ▼ Show 20 Lines | CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, | ||||
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 fInboundIn) | ||||
: nTimeConnected(GetSystemTimeInSeconds()), addr(addrIn), | : nTimeConnected(GetSystemTimeInSeconds()), addr(addrIn), | ||||
addrBind(addrBindIn), fInbound(fInboundIn), | addrBind(addrBindIn), fInbound(fInboundIn), | ||||
nKeyedNetGroup(nKeyedNetGroupIn), addrKnown(5000, 0.001), | nKeyedNetGroup(nKeyedNetGroupIn), addrKnown(5000, 0.001), | ||||
filterInventoryKnown(50000, 0.000001), id(idIn), | filterInventoryKnown(50000, 0.000001), id(idIn), | ||||
nLocalHostNonce(nLocalHostNonceIn), nLocalServices(nLocalServicesIn), | nLocalHostNonce(nLocalHostNonceIn), nLocalServices(nLocalServicesIn), | ||||
nMyStartingHeight(nMyStartingHeightIn), nSendVersion(0) { | nMyStartingHeight(nMyStartingHeightIn) { | ||||
nServices = NODE_NONE; | |||||
hSocket = hSocketIn; | hSocket = hSocketIn; | ||||
nRecvVersion = INIT_PROTO_VERSION; | |||||
nLastSend = 0; | |||||
nLastRecv = 0; | |||||
nSendBytes = 0; | |||||
nRecvBytes = 0; | |||||
nTimeOffset = 0; | |||||
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; | addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; | ||||
nVersion = 0; | |||||
strSubVer = ""; | strSubVer = ""; | ||||
fWhitelisted = false; | |||||
fOneShot = false; | |||||
m_manual_connection = false; | |||||
// set by version message | |||||
fClient = false; | |||||
// set by version message | |||||
m_limited_node = false; | |||||
fFeeler = false; | |||||
fSuccessfullyConnected = false; | |||||
fDisconnect = false; | |||||
nRefCount = 0; | |||||
nSendSize = 0; | |||||
nSendOffset = 0; | |||||
hashContinue = uint256(); | hashContinue = uint256(); | ||||
nStartingHeight = -1; | |||||
filterInventoryKnown.reset(); | filterInventoryKnown.reset(); | ||||
fSendMempool = false; | |||||
fGetAddr = false; | |||||
nNextLocalAddrSend = 0; | |||||
nNextAddrSend = 0; | |||||
nNextInvSend = 0; | |||||
fRelayTxes = false; | |||||
fSentAddr = false; | |||||
pfilter = std::make_unique<CBloomFilter>(); | pfilter = std::make_unique<CBloomFilter>(); | ||||
timeLastMempoolReq = 0; | |||||
nLastBlockTime = 0; | |||||
nLastTXTime = 0; | |||||
nPingNonceSent = 0; | |||||
nPingUsecStart = 0; | |||||
nPingUsecTime = 0; | |||||
fPingQueued = false; | |||||
nMinPingUsecTime = std::numeric_limits<int64_t>::max(); | |||||
minFeeFilter = Amount::zero(); | |||||
lastSentFeeFilter = Amount::zero(); | |||||
nextSendTimeFeeFilter = 0; | |||||
fPauseRecv = false; | |||||
fPauseSend = false; | |||||
nProcessQueueSize = 0; | |||||
for (const std::string &msg : getAllNetMessageTypes()) { | for (const std::string &msg : getAllNetMessageTypes()) { | ||||
mapRecvBytesPerMsgCmd[msg] = 0; | mapRecvBytesPerMsgCmd[msg] = 0; | ||||
} | } | ||||
mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0; | mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0; | ||||
if (fLogIPs) { | if (fLogIPs) { | ||||
LogPrint(BCLog::NET, "Added connection to %s peer=%d\n", addrName, id); | LogPrint(BCLog::NET, "Added connection to %s peer=%d\n", addrName, id); | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |