mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
net: Introduce CConnection::Options to avoid passing so many params
This commit is contained in:
parent
bafa5fc5a1
commit
a19553b992
3 changed files with 26 additions and 10 deletions
11
src/init.cpp
11
src/init.cpp
|
|
@ -1515,8 +1515,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||
MapPort(GetBoolArg("-upnp", DEFAULT_UPNP));
|
||||
|
||||
std::string strNodeError;
|
||||
int nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections);
|
||||
if(!connman.Start(threadGroup, scheduler, nLocalServices, nRelevantServices, nMaxConnections, nMaxOutbound, chainActive.Height(), &uiInterface, strNodeError))
|
||||
CConnman::Options connOptions;
|
||||
connOptions.nLocalServices = nLocalServices;
|
||||
connOptions.nRelevantServices = nRelevantServices;
|
||||
connOptions.nMaxConnections = nMaxConnections;
|
||||
connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections);
|
||||
connOptions.nBestHeight = chainActive.Height();
|
||||
connOptions.uiInterface = &uiInterface;
|
||||
|
||||
if(!connman.Start(threadGroup, scheduler, strNodeError, connOptions))
|
||||
return InitError(strNodeError);
|
||||
|
||||
// ********************************************************* Step 12: finished
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue