aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-12-31 02:05:15 -0500
committerCory Fields <cory-nospam-@coryfields.com>2017-01-04 10:10:35 -0500
commit56212e20acf1534d443cb910c9bf3a30f84d0f02 (patch)
tree5c67422a02655f9c919571ac7f07823fddc35f97 /src/net.h
parent0e973d970a2114c11f4a95f09721d977da7f0a94 (diff)
downloadbitcoin-56212e20acf1534d443cb910c9bf3a30f84d0f02.tar.xz
net: set message deserialization version when it's actually time to deserialize
We'll soon no longer have access to vRecvMsg, and this is more intuitive anyway.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index a11165c7e3..6c12171bf2 100644
--- a/src/net.h
+++ b/src/net.h
@@ -607,7 +607,7 @@ public:
std::list<CNetMessage> vRecvMsg;
CCriticalSection cs_vRecvMsg;
uint64_t nRecvBytes;
- int nRecvVersion;
+ std::atomic<int> nRecvVersion;
int64_t nLastSend;
int64_t nLastRecv;
@@ -747,12 +747,13 @@ public:
// requires LOCK(cs_vRecvMsg)
bool ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete);
- // requires LOCK(cs_vRecvMsg)
void SetRecvVersion(int nVersionIn)
{
nRecvVersion = nVersionIn;
- BOOST_FOREACH(CNetMessage &msg, vRecvMsg)
- msg.SetVersion(nVersionIn);
+ }
+ int GetRecvVersion()
+ {
+ return nRecvVersion;
}
void SetSendVersion(int nVersionIn)
{