diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-08-05 15:42:30 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-08-05 15:43:10 +0200 |
commit | c3848000277d5ab6b5f5faecb1d21b89374ef999 (patch) | |
tree | ea62f8f84cfe6c7d7b11189e048969399d80b6ae /src/init.cpp | |
parent | c9c017adf6a7b78f609f5fc61fd91dfa2e3d9662 (diff) | |
parent | 7b79cbd722d35b8113d5136b06d4a8e5fd569fc6 (diff) |
Merge pull request #6462
7b79cbd limit total length of user agent comments (Pavol Rusnak)
557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index c92e9a7692..ef1c39db25 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1020,6 +1020,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) RegisterNodeSignals(GetNodeSignals()); + // format user agent, check total size + strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, mapMultiArgs.count("-uacomment") ? mapMultiArgs["-uacomment"] : std::vector<string>()); + if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) { + return InitError(strprintf("Total length of network version string %i exceeds maximum of %i characters. Reduce the number and/or size of uacomments.", + strSubVersion.size(), MAX_SUBVERSION_LENGTH)); + } + if (mapArgs.count("-onlynet")) { std::set<enum Network> nets; BOOST_FOREACH(const std::string& snet, mapMultiArgs["-onlynet"]) { |