diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-10-31 17:06:15 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-10-31 17:17:18 -0400 |
commit | aff6584e09938768838a768b67722db553cf8ef4 (patch) | |
tree | 3d4053d1eb40ab7452a5fe6603d5805f196e8941 /src/net.cpp | |
parent | 3d69ecb4edeb80003a1a41442e320898a30dbd9c (diff) |
net: constify a few CNode vars to indicate that they're threadsafe
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 48ba9588d9..f27516aae6 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2512,9 +2512,13 @@ unsigned int CConnman::GetSendBufferSize() const{ return nSendBufferMaxSize; } CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, const std::string& addrNameIn, bool fInboundIn) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), addr(addrIn), + fInbound(fInboundIn), + id(idIn), nKeyedNetGroup(nKeyedNetGroupIn), addrKnown(5000, 0.001), - filterInventoryKnown(50000, 0.000001) + filterInventoryKnown(50000, 0.000001), + nLocalServices(nLocalServicesIn), + nMyStartingHeight(nMyStartingHeightIn) { nServices = NODE_NONE; nServicesExpected = NODE_NONE; @@ -2533,7 +2537,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn fOneShot = false; fClient = false; // set by version message fFeeler = false; - fInbound = fInboundIn; fNetworkNode = false; fSuccessfullyConnected = false; fDisconnect = false; @@ -2562,12 +2565,8 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn minFeeFilter = 0; lastSentFeeFilter = 0; nextSendTimeFeeFilter = 0; - id = idIn; nOptimisticBytesWritten = 0; - nLocalServices = nLocalServicesIn; - GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); - nMyStartingHeight = nMyStartingHeightIn; BOOST_FOREACH(const std::string &msg, getAllNetMessageTypes()) mapRecvBytesPerMsgCmd[msg] = 0; |