@@ -1063,7 +1063,7 @@ void CConnman::ThreadSocketHandler()
1063
1063
BOOST_FOREACH (CNode* pnode, vNodesCopy)
1064
1064
{
1065
1065
if (pnode->fDisconnect ||
1066
- (pnode->GetRefCount () <= 0 && pnode->vRecvMsg .empty () && pnode->nSendSize == 0 && pnode-> ssSend . empty () ))
1066
+ (pnode->GetRefCount () <= 0 && pnode->vRecvMsg .empty () && pnode->nSendSize == 0 ))
1067
1067
{
1068
1068
// remove from vNodes
1069
1069
vNodes.erase (remove (vNodes.begin (), vNodes.end (), pnode), vNodes.end ());
@@ -2482,46 +2482,10 @@ int CConnman::GetBestHeight() const
2482
2482
return nBestHeight.load (std::memory_order_acquire);
2483
2483
}
2484
2484
2485
- void CNode::Fuzz (int nChance)
2486
- {
2487
- if (!fSuccessfullyConnected ) return ; // Don't fuzz initial handshake
2488
- if (GetRand (nChance) != 0 ) return ; // Fuzz 1 of every nChance messages
2489
-
2490
- switch (GetRand (3 ))
2491
- {
2492
- case 0 :
2493
- // xor a random byte with a random value:
2494
- if (!ssSend.empty ()) {
2495
- CDataStream::size_type pos = GetRand (ssSend.size ());
2496
- ssSend[pos] ^= (unsigned char )(GetRand (256 ));
2497
- }
2498
- break ;
2499
- case 1 :
2500
- // delete a random byte:
2501
- if (!ssSend.empty ()) {
2502
- CDataStream::size_type pos = GetRand (ssSend.size ());
2503
- ssSend.erase (ssSend.begin ()+pos);
2504
- }
2505
- break ;
2506
- case 2 :
2507
- // insert a random byte at a random position
2508
- {
2509
- CDataStream::size_type pos = GetRand (ssSend.size ());
2510
- char ch = (char )GetRand (256 );
2511
- ssSend.insert (ssSend.begin ()+pos, ch);
2512
- }
2513
- break ;
2514
- }
2515
- // Chance of more than one change half the time:
2516
- // (more changes exponentially less likely):
2517
- Fuzz (2 );
2518
- }
2519
-
2520
2485
unsigned int CConnman::GetReceiveFloodSize () const { return nReceiveFloodSize; }
2521
2486
unsigned int CConnman::GetSendBufferSize () const { return nSendBufferMaxSize; }
2522
2487
2523
2488
CNode::CNode (NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const std::string& addrNameIn, bool fInboundIn ) :
2524
- ssSend(SER_NETWORK, INIT_PROTO_VERSION),
2525
2489
addr(addrIn),
2526
2490
fInbound(fInboundIn ),
2527
2491
id(idIn),
0 commit comments