Skip to content

Commit

Permalink
net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options
Browse files Browse the repository at this point in the history
  • Loading branch information
theuni authored and Fuzzbawls committed Aug 25, 2020
1 parent 22a9aff commit 276c946
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,8 @@ bool AppInit2()
connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections);
connOptions.nBestHeight = chainActive.Height();
connOptions.uiInterface = &uiInterface;
connOptions.nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
connOptions.nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);

if(!connman.Start(threadGroup, scheduler, strNodeError, connOptions))
return UIError(strNodeError);
Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1976,8 +1976,8 @@ bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, st
nMaxConnections = connOptions.nMaxConnections;
nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections);

nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
nSendBufferMaxSize = connOptions.nSendBufferMaxSize;
nReceiveFloodSize = connOptions.nSendBufferMaxSize;

SetBestHeight(connOptions.nBestHeight);

Expand Down
2 changes: 2 additions & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class CConnman
int nMaxOutbound = 0;
int nBestHeight = 0;
CClientUIInterface* uiInterface = nullptr;
unsigned int nSendBufferMaxSize = 0;
unsigned int nReceiveFloodSize = 0;
};
CConnman();
~CConnman();
Expand Down

0 comments on commit 276c946

Please sign in to comment.