diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-16 16:26:14 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-19 10:24:23 -0500 |
commit | f8ded588a2f78ac2767a60c716a7d15c273b4fc7 (patch) | |
tree | f8bb01303f5feb0bf04a8fb01ada04b58304a207 /src/main.cpp | |
parent | 8896c2d9d64d71e25b31d7a389f0b8db49a1e50a (diff) |
Implement BIP 14 : separate protocol version from client version
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index a7871fcc16..1da28d4d9f 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)); } |