aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-12-19 07:25:16 -0800
committerGavin Andresen <[email protected]>2011-12-19 07:25:16 -0800
commit1f3bc1c2399fb53eb1b2222194332aca07a31a36 (patch)
treee7afd7d6d4b892af685985f75d5b3d7b5c2330be /src/main.cpp
parentMerge pull request #709 from luke-jr/newdnsseeds (diff)
parentImplement BIP 14 : separate protocol version from client version (diff)
downloaddiscoin-1f3bc1c2399fb53eb1b2222194332aca07a31a36.tar.xz
discoin-1f3bc1c2399fb53eb1b2222194332aca07a31a36.zip
Merge pull request #707 from gavinandresen/BIP14
Implement BIP 14 : separate protocol version from client version
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a7871fcc1..1da28d4d9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,6 +17,11 @@ using namespace boost;
// Global state
//
+// Name of client reported in the 'version' message. Report the same name
+// for both bitcoind and bitcoin-qt, to make it harder for attackers to
+// target servers or GUI users specifically.
+const std::string CLIENT_NAME("bitcoin-qt");
+
CCriticalSection cs_setpwalletRegistered;
set<CWallet*> setpwalletRegistered;
@@ -1847,9 +1852,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Change version
if (pfrom->nVersion >= 209)
pfrom->PushMessage("verack");
- pfrom->vSend.SetVersion(min(pfrom->nVersion, VERSION));
+ pfrom->vSend.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
if (pfrom->nVersion < 209)
- pfrom->vRecv.SetVersion(min(pfrom->nVersion, VERSION));
+ pfrom->vRecv.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
if (!pfrom->fInbound)
{
@@ -1902,7 +1907,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
else if (strCommand == "verack")
{
- pfrom->vRecv.SetVersion(min(pfrom->nVersion, VERSION));
+ pfrom->vRecv.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
}