Browse Source

net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options

0.14
Cory Fields 9 years ago
parent
commit
fa2f8bc47f
  1. 2
      src/init.cpp
  2. 4
      src/net.cpp
  3. 2
      src/net.h

2
src/init.cpp

@ -1522,6 +1522,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections); connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections);
connOptions.nBestHeight = chainActive.Height(); connOptions.nBestHeight = chainActive.Height();
connOptions.uiInterface = &uiInterface; connOptions.uiInterface = &uiInterface;
connOptions.nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
connOptions.nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
if(!connman.Start(threadGroup, scheduler, strNodeError, connOptions)) if(!connman.Start(threadGroup, scheduler, strNodeError, connOptions))
return InitError(strNodeError); return InitError(strNodeError);

4
src/net.cpp

@ -2063,8 +2063,8 @@ bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, st
nMaxConnections = connOptions.nMaxConnections; nMaxConnections = connOptions.nMaxConnections;
nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections); nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections);
nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); nSendBufferMaxSize = connOptions.nSendBufferMaxSize;
nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); nReceiveFloodSize = connOptions.nSendBufferMaxSize;
SetBestHeight(connOptions.nBestHeight); SetBestHeight(connOptions.nBestHeight);

2
src/net.h

@ -117,6 +117,8 @@ public:
int nMaxOutbound = 0; int nMaxOutbound = 0;
int nBestHeight = 0; int nBestHeight = 0;
CClientUIInterface* uiInterface = nullptr; CClientUIInterface* uiInterface = nullptr;
unsigned int nSendBufferMaxSize = 0;
unsigned int nReceiveFloodSize = 0;
}; };
CConnman(); CConnman();
~CConnman(); ~CConnman();

Loading…
Cancel
Save