|
|
@ -2049,26 +2049,26 @@ NodeId CConnman::GetNewNodeId() |
|
|
|
return nLastNodeId.fetch_add(1, std::memory_order_relaxed); |
|
|
|
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; |
|
|
|
nTotalBytesRecv = 0; |
|
|
|
nTotalBytesSent = 0; |
|
|
|
nTotalBytesSent = 0; |
|
|
|
nMaxOutboundLimit = 0; |
|
|
|
nMaxOutboundLimit = 0; |
|
|
|
nMaxOutboundTotalBytesSentInCycle = 0; |
|
|
|
nMaxOutboundTotalBytesSentInCycle = 0; |
|
|
|
nMaxOutboundTimeframe = 60*60*24; //1 day
|
|
|
|
nMaxOutboundTimeframe = 60*60*24; //1 day
|
|
|
|
nLocalServices = nLocalServicesIn; |
|
|
|
|
|
|
|
nRelevantServices = nRelevantServicesIn; |
|
|
|
|
|
|
|
nMaxOutboundCycleStartTime = 0; |
|
|
|
nMaxOutboundCycleStartTime = 0; |
|
|
|
|
|
|
|
|
|
|
|
nMaxConnections = nMaxConnectionsIn; |
|
|
|
nRelevantServices = connOptions.nRelevantServices; |
|
|
|
nMaxOutbound = std::min((nMaxOutboundIn), nMaxConnections); |
|
|
|
nLocalServices = connOptions.nLocalServices; |
|
|
|
|
|
|
|
nMaxConnections = connOptions.nMaxConnections; |
|
|
|
|
|
|
|
nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections); |
|
|
|
|
|
|
|
|
|
|
|
nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); |
|
|
|
nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); |
|
|
|
nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); |
|
|
|
nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); |
|
|
|
|
|
|
|
|
|
|
|
SetBestHeight(nBestHeightIn); |
|
|
|
SetBestHeight(connOptions.nBestHeight); |
|
|
|
|
|
|
|
|
|
|
|
clientInterface = interfaceIn; |
|
|
|
clientInterface = connOptions.uiInterface; |
|
|
|
if (clientInterface) |
|
|
|
if (clientInterface) |
|
|
|
clientInterface->InitMessage(_("Loading addresses...")); |
|
|
|
clientInterface->InitMessage(_("Loading addresses...")); |
|
|
|
// Load addresses from peers.dat
|
|
|
|
// Load addresses from peers.dat
|
|
|
|