aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMike Hearn <hearn@google.com>2013-11-26 12:52:21 +0100
committerGavin Andresen <gavinandresen@gmail.com>2013-11-28 11:03:33 +1000
commit7120d76dc6fc9d86aac5d3a5454f248de5a5853f (patch)
treea163b0f198951ca7b6e3e8c71b70e3c6b8f7ec5c /src/net.h
parent1c53d0a4fbdc1efd9ed316556a12fb52082db32e (diff)
downloadbitcoin-7120d76dc6fc9d86aac5d3a5454f248de5a5853f.tar.xz
Store and use a sanitized subVer
Rebased-from: a946aa8d3ec7009ac670eeb65a525efe5eeb6e84
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 6f315f74fd..dfdd3c8137 100644
--- a/src/net.h
+++ b/src/net.h
@@ -98,7 +98,7 @@ public:
int64 nTimeConnected;
std::string addrName;
int nVersion;
- std::string strSubVer;
+ std::string cleanSubVer;
bool fInbound;
int nStartingHeight;
int nMisbehavior;
@@ -177,7 +177,11 @@ public:
std::string addrName;
CService addrLocal;
int nVersion;
- std::string strSubVer;
+ // 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
+ // store the sanitized version in cleanSubVer. The original should be used when dealing with
+ // the network or wire types and the cleaned string used when displayed or logged.
+ std::string strSubVer, cleanSubVer;
bool fOneShot;
bool fClient;
bool fInbound;