Skip to content

Commit 557f8ea

Browse files
committed
implement uacomment config parameter
which can add comments to user agent as per BIP-0014
1 parent 86cfd23 commit 557f8ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void CNode::PushVersion()
445445
else
446446
LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id);
447447
PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe,
448-
nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight, true);
448+
nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, mapMultiArgs.count("-uacomment") ? mapMultiArgs["-uacomment"] : std::vector<string>()), nBestHeight, true);
449449
}
450450

451451

src/rpcnet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp)
444444
UniValue obj(UniValue::VOBJ);
445445
obj.push_back(Pair("version", CLIENT_VERSION));
446446
obj.push_back(Pair("subversion",
447-
FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>())));
447+
FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, mapMultiArgs.count("-uacomment") ? mapMultiArgs["-uacomment"] : std::vector<string>())));
448448
obj.push_back(Pair("protocolversion",PROTOCOL_VERSION));
449449
obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices)));
450450
obj.push_back(Pair("timeoffset", GetTimeOffset()));

0 commit comments

Comments
 (0)