From e6e29e3c94c65a87df2d05cca54591f41a571636 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:43:49 +0100 Subject: [PATCH] scripted-diff: Clarify "user agent" variable name This change allows to the use of the `CLIENT_` namespace without potential name clashes. -BEGIN VERIFY SCRIPT- sed -i "s/\/UA_NAME/g" $( git grep -l "CLIENT_NAME" ./src) -END VERIFY SCRIPT- --- src/clientversion.cpp | 2 +- src/clientversion.h | 2 +- src/init.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 3943c4fb1d4..7cdbda7de21 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -20,7 +20,7 @@ using util::Join; * for both bitcoind and bitcoin-qt, to make it harder for attackers to * target servers or GUI users specifically. */ -const std::string CLIENT_NAME("Satoshi"); +const std::string UA_NAME("Satoshi"); #include diff --git a/src/clientversion.h b/src/clientversion.h index d1202b1259a..03b96d0124a 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -33,7 +33,7 @@ static const int CLIENT_VERSION = + 100 * CLIENT_VERSION_MINOR + 1 * CLIENT_VERSION_BUILD; -extern const std::string CLIENT_NAME; +extern const std::string UA_NAME; std::string FormatFullVersion(); diff --git a/src/init.cpp b/src/init.cpp index 587e7cb42b5..74a69e324ac 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1464,7 +1464,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) return InitError(strprintf(_("User Agent comment (%s) contains unsafe characters."), cmt)); uacomments.push_back(cmt); } - strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments); + strSubVersion = FormatSubVersion(UA_NAME, CLIENT_VERSION, uacomments); if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) { return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments."), strSubVersion.size(), MAX_SUBVERSION_LENGTH));