aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-02-02 14:33:41 -0500
committerCory Fields <cory-nospam-@coryfields.com>2017-02-02 16:14:16 -0500
commit08bb6f4ed48359aedd869450b99799b9c734084b (patch)
tree57b415e1f950001d44192ec2d071875661a27f19 /src/net.h
parent7a8c2519015650acd51eaf42719f04e53f839bbe (diff)
downloadbitcoin-08bb6f4ed48359aedd869450b99799b9c734084b.tar.xz
net: log an error rather than asserting if send version is misused
Also cleaned up the comments and moved from the header to the .cpp so that logging headers aren't needed from net.h
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/net.h b/src/net.h
index 05f178f9c5..1e3033785e 100644
--- a/src/net.h
+++ b/src/net.h
@@ -723,25 +723,8 @@ public:
{
return nRecvVersion;
}
- void SetSendVersion(int nVersionIn)
- {
- // Send version may only be changed in the version message, and
- // only one version message is allowed per session. We can therefore
- // treat this value as const and even atomic as long as it's only used
- // once the handshake is complete. Any attempt to set this twice is an
- // error.
- assert(nSendVersion == 0);
- nSendVersion = nVersionIn;
- }
-
- int GetSendVersion() const
- {
- // The send version should always be explicitly set to
- // INIT_PROTO_VERSION rather than using this value until the handshake
- // is complete.
- assert(nSendVersion != 0);
- return nSendVersion;
- }
+ void SetSendVersion(int nVersionIn);
+ int GetSendVersion() const;
CNode* AddRef()
{