Skip to content

Commit 276c946

Browse files
theuniFuzzbawls
authored andcommitted
net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options
1 parent 22a9aff commit 276c946

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,8 @@ bool AppInit2()
18941894
connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections);
18951895
connOptions.nBestHeight = chainActive.Height();
18961896
connOptions.uiInterface = &uiInterface;
1897+
connOptions.nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
1898+
connOptions.nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
18971899

18981900
if(!connman.Start(threadGroup, scheduler, strNodeError, connOptions))
18991901
return UIError(strNodeError);

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,8 +1976,8 @@ bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, st
19761976
nMaxConnections = connOptions.nMaxConnections;
19771977
nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections);
19781978

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

19821982
SetBestHeight(connOptions.nBestHeight);
19831983

src/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class CConnman
121121
int nMaxOutbound = 0;
122122
int nBestHeight = 0;
123123
CClientUIInterface* uiInterface = nullptr;
124+
unsigned int nSendBufferMaxSize = 0;
125+
unsigned int nReceiveFloodSize = 0;
124126
};
125127
CConnman();
126128
~CConnman();

0 commit comments

Comments
 (0)