whitespace

This commit is contained in:
Christopher Jeffrey 2014-08-13 14:28:49 -04:00
parent d423d8818c
commit 2155513e4a

View File

@ -608,16 +608,16 @@ namespace {
} }
void StartNode(boost::thread_group& threadGroup) void StartNode(boost::thread_group& threadGroup) {
{
if (semOutbound == NULL) { if (semOutbound == NULL) {
// initialize semaphore // initialize semaphore
int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections); int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections);
semOutbound = new CSemaphore(nMaxOutbound); semOutbound = new CSemaphore(nMaxOutbound);
} }
if (pnodeLocalHost == NULL) if (pnodeLocalHost == NULL) {
pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices)); pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices));
}
Discover(threadGroup); Discover(threadGroup);
@ -625,10 +625,11 @@ void StartNode(boost::thread_group& threadGroup)
// Start threads // Start threads
// //
if (!GetBoolArg("-dnsseed", true)) if (!GetBoolArg("-dnsseed", true)) {
LogPrintf("DNS seeding disabled\n"); LogPrintf("DNS seeding disabled\n");
else } else {
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed)); threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed));
}
// Map ports with UPnP // Map ports with UPnP
MapPort(GetBoolArg("-upnp", DEFAULT_UPNP)); MapPort(GetBoolArg("-upnp", DEFAULT_UPNP));
@ -646,19 +647,22 @@ void StartNode(boost::thread_group& threadGroup)
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "msghand", &ThreadMessageHandler)); threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "msghand", &ThreadMessageHandler));
// Dump network addresses // Dump network addresses
threadGroup.create_thread(boost::bind(&LoopForever<void (*)()>, "dumpaddr", &DumpAddresses, DUMP_ADDRESSES_INTERVAL * 1000)); threadGroup.create_thread(boost::bind(&LoopForever<void (*)()>, "dumpaddr",
&DumpAddresses, DUMP_ADDRESSES_INTERVAL * 1000));
} }
bool StopNode() bool StopNode() {
{
LogPrintf("StopNode()\n"); LogPrintf("StopNode()\n");
MapPort(false); MapPort(false);
if (semOutbound)
for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++) if (semOutbound) {
for (int i = 0; i < MAX_OUTBOUND_CONNECTIONS; i++) {
semOutbound->post(); semOutbound->post();
}
}
MilliSleep(50); MilliSleep(50);
DumpAddresses(); DumpAddresses();
return true; return true;
} }