aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-02-06 12:04:34 -0500
committerMatt Corallo <git@bluematt.me>2017-02-10 11:32:41 -0500
commit036073bf87c07f8d69e39168dd93a52f1aafe85c (patch)
tree95cdeea1af6e92752009b265b4f1b67e1d040f7f /src/net.h
parentd8f2b8a8c032b83a3bd90750e58abaeece7e34e7 (diff)
Move CNode::addrName accesses behind locked accessors
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index ddc050eb1f..2cfc74e3d5 100644
--- a/src/net.h
+++ b/src/net.h
@@ -590,7 +590,6 @@ public:
const int64_t nTimeConnected;
std::atomic<int64_t> nTimeOffset;
const CAddress addr;
- std::string addrName;
CService addrLocal;
std::atomic<int> nVersion;
// strSubVer is whatever byte array we read from the wire. However, this field is intended
@@ -696,6 +695,9 @@ private:
const int nMyStartingHeight;
int nSendVersion;
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
+
+ mutable CCriticalSection cs_addrName;
+ std::string addrName;
public:
NodeId GetId() const {
@@ -798,6 +800,10 @@ public:
{
return nLocalServices;
}
+
+ std::string GetAddrName() const;
+ //! Sets the addrName only if it was not previously set
+ void MaybeSetAddrName(const std::string& addrNameIn);
};