aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-02-06 12:18:51 -0500
committerMatt Corallo <git@bluematt.me>2017-02-10 11:32:41 -0500
commitdb2dc7a58cb0a3df58188b748df8e0d04ba76f00 (patch)
tree061df504e100195d1dc93313652c9e2a1ecdc545 /src/net.h
parent036073bf87c07f8d69e39168dd93a52f1aafe85c (diff)
Move CNode::addrLocal access 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 2cfc74e3d5..29b6a44c88 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;
- CService addrLocal;
std::atomic<int> nVersion;
// strSubVer is whatever byte array we read from the wire. However, this field is intended
// to be printed out, displayed to humans in various forms and so on. So we sanitize it and
@@ -698,6 +697,9 @@ private:
mutable CCriticalSection cs_addrName;
std::string addrName;
+
+ CService addrLocal;
+ mutable CCriticalSection cs_addrLocal;
public:
NodeId GetId() const {
@@ -731,6 +733,10 @@ public:
void SetSendVersion(int nVersionIn);
int GetSendVersion() const;
+ CService GetAddrLocal() const;
+ //! May not be called more than once
+ void SetAddrLocal(const CService& addrLocalIn);
+
CNode* AddRef()
{
nRefCount++;