@@ -3097,8 +3097,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3097
3097
pfrom->nVersion = 300 ;
3098
3098
if (!vRecv.empty ())
3099
3099
vRecv >> addrFrom >> nNonce;
3100
- if (!vRecv.empty ())
3100
+ if (!vRecv.empty ()) {
3101
3101
vRecv >> pfrom->strSubVer ;
3102
+ pfrom->cleanSubVer = SanitizeString (pfrom->strSubVer );
3103
+ }
3102
3104
if (!vRecv.empty ())
3103
3105
vRecv >> pfrom->nStartingHeight ;
3104
3106
if (!vRecv.empty ())
@@ -3165,7 +3167,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3165
3167
3166
3168
pfrom->fSuccessfullyConnected = true ;
3167
3169
3168
- LogPrintf (" receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s\n " , pfrom->strSubVer .c_str (), pfrom->nVersion , pfrom->nStartingHeight , addrMe.ToString ().c_str (), addrFrom.ToString ().c_str (), pfrom->addr .ToString ().c_str ());
3170
+ LogPrintf (" receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s\n " , pfrom->cleanSubVer .c_str (), pfrom->nVersion , pfrom->nStartingHeight , addrMe.ToString ().c_str (), addrFrom.ToString ().c_str (), pfrom->addr .ToString ().c_str ());
3169
3171
3170
3172
AddTimeData (pfrom->addr , nTime);
3171
3173
@@ -3426,7 +3428,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3426
3428
3427
3429
3428
3430
LogPrint (" mempool" , " AcceptToMemoryPool: %s %s : accepted %s (poolsz %" PRIszu" )\n " ,
3429
- pfrom->addr .ToString ().c_str (), pfrom->strSubVer .c_str (),
3431
+ pfrom->addr .ToString ().c_str (), pfrom->cleanSubVer .c_str (),
3430
3432
tx.GetHash ().ToString ().c_str (),
3431
3433
mempool.mapTx .size ());
3432
3434
@@ -3480,7 +3482,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3480
3482
if (state.IsInvalid (nDoS))
3481
3483
{
3482
3484
LogPrint (" mempool" , " %s from %s %s was not accepted into the memory pool: %s\n " , tx.GetHash ().ToString ().c_str (),
3483
- pfrom->addr .ToString ().c_str (), pfrom->strSubVer .c_str (),
3485
+ pfrom->addr .ToString ().c_str (), pfrom->cleanSubVer .c_str (),
3484
3486
state.GetRejectReason ().c_str ());
3485
3487
pfrom->PushMessage (" reject" , strCommand, state.GetRejectCode (),
3486
3488
state.GetRejectReason (), inv.hash );
@@ -3618,7 +3620,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3618
3620
if (!(sProblem .empty ())) {
3619
3621
LogPrint (" net" , " pong %s %s: %s, %" PRIx64" expected, %" PRIx64" received, %" PRIszu" bytes\n " ,
3620
3622
pfrom->addr .ToString ().c_str (),
3621
- pfrom->strSubVer .c_str (),
3623
+ pfrom->cleanSubVer .c_str (),
3622
3624
sProblem .c_str (),
3623
3625
pfrom->nPingNonceSent ,
3624
3626
nonce,
0 commit comments