aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-05-26 23:53:08 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 13:04:29 -0400
commita19553b992f40b9f98e6e0be4cd529a89746ef50 (patch)
tree7d8bdf280d59714df83e438324867ff374d15bb6 /src/net.cpp
parentbafa5fc5a1ba33337b5eb3d8ae24ba2fac2949f8 (diff)
net: Introduce CConnection::Options to avoid passing so many params
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 15c066cd7c..8ea600b371 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2049,26 +2049,26 @@ NodeId CConnman::GetNewNodeId()
return nLastNodeId.fetch_add(1, std::memory_order_relaxed);
}
-bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, ServiceFlags nLocalServicesIn, ServiceFlags nRelevantServicesIn, int nMaxConnectionsIn, int nMaxOutboundIn, int nBestHeightIn, CClientUIInterface* interfaceIn, std::string& strNodeError)
+bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, std::string& strNodeError, Options connOptions)
{
nTotalBytesRecv = 0;
nTotalBytesSent = 0;
nMaxOutboundLimit = 0;
nMaxOutboundTotalBytesSentInCycle = 0;
nMaxOutboundTimeframe = 60*60*24; //1 day
- nLocalServices = nLocalServicesIn;
- nRelevantServices = nRelevantServicesIn;
nMaxOutboundCycleStartTime = 0;
- nMaxConnections = nMaxConnectionsIn;
- nMaxOutbound = std::min((nMaxOutboundIn), nMaxConnections);
+ nRelevantServices = connOptions.nRelevantServices;
+ nLocalServices = connOptions.nLocalServices;
+ nMaxConnections = connOptions.nMaxConnections;
+ nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections);
nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
- SetBestHeight(nBestHeightIn);
+ SetBestHeight(connOptions.nBestHeight);
- clientInterface = interfaceIn;
+ clientInterface = connOptions.uiInterface;
if (clientInterface)
clientInterface->InitMessage(_("Loading addresses..."));
// Load addresses from peers.dat