From 3777ab4250868cb2cbd97efd97e4951e23a2be4b Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 13 Aug 2015 17:31:03 -0400 Subject: [PATCH] Bitcore node in the user-agent (subversion) - There is a comments section that can be used in the FormatSubVersion string for the user agent that is exchanged between peers - The comments section allows arbitrary strings to be added per the client - This is the most appropriate place to include the bitcore-node message - A string similar to: "/Satoshi:0.11.0(bitcorenode)/" will be passed as a response to getpeerinfo or getnetworkinfo --- etc/bitcoin.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etc/bitcoin.patch b/etc/bitcoin.patch index 85943511..1a6b6ca6 100644 --- a/etc/bitcoin.patch +++ b/etc/bitcoin.patch @@ -355,3 +355,17 @@ index c65e842..0e44bb5 100644 CLevelDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); ~CLevelDBWrapper(); +diff --git a/src/net.cpp b/src/net.cpp +index 3908be6..cf3ffd4 100644 +--- a/src/net.cpp ++++ b/src/net.cpp +@@ -426,8 +426,10 @@ void CNode::PushVersion() + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); + else + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); ++ std::vector bitcore_node; ++ bitcore_node.push_back("bitcorenode"); //the dash character is removed from the comments section + PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, +- nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector()), nBestHeight, true); ++ nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, bitcore_node), nBestHeight, true); + }