mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Merge #15654: net: Remove unused unsanitized user agent string CNode::strSubVer
fa8548c5d1net: Remove unused unsanitized user agent string CNode::strSubVer (MarcoFalke) Pull request description: I fail to see a use case for this unsanitized byte array. In fact this can easily be confused with `cleanSubVer` and be displayed to the user (or logged) by a simple typo that is hard to find in review. Further reading: https://btcinformation.org/en/developer-reference#version ACKs for commit fa8548: promag: utACKfa8548c, good catch. practicalswift: utACKfa8548c5d1sipa: utACKfa8548c5d1Tree-SHA512: 3c3ff1504d1583ad099df9a6aa761458a82ec48a58ef7aaa9b5679a5281dd1b59036ba2932ed708488951a565b669a3083ef70be5a58472ff8677b971162ae2f
This commit is contained in:
@@ -1843,7 +1843,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
ServiceFlags nServices;
|
||||
int nVersion;
|
||||
int nSendVersion;
|
||||
std::string strSubVer;
|
||||
std::string cleanSubVer;
|
||||
int nStartingHeight = -1;
|
||||
bool fRelay = true;
|
||||
@@ -1880,6 +1879,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
if (!vRecv.empty())
|
||||
vRecv >> addrFrom >> nNonce;
|
||||
if (!vRecv.empty()) {
|
||||
std::string strSubVer;
|
||||
vRecv >> LIMITED_STRING(strSubVer, MAX_SUBVERSION_LENGTH);
|
||||
cleanSubVer = SanitizeString(strSubVer);
|
||||
}
|
||||
@@ -1911,7 +1911,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
pfrom->SetAddrLocal(addrMe);
|
||||
{
|
||||
LOCK(pfrom->cs_SubVer);
|
||||
pfrom->strSubVer = strSubVer;
|
||||
pfrom->cleanSubVer = cleanSubVer;
|
||||
}
|
||||
pfrom->nStartingHeight = nStartingHeight;
|
||||
|
||||
Reference in New Issue
Block a user