mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Move CNode::addrLocal access behind locked accessors
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user