X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Finit.cpp;h=08013119d8d0205ea36db17a8215f43dcac276c5;hp=994c7843f0a80025d62a1ffdd8bd8977d2f3135a;hb=c95d66bd55a225326e81dce15d347f04b1d71d67;hpb=ebbcbf24322c0d1e5d3e386a1edb0a3b48667ae7 diff --git a/src/init.cpp b/src/init.cpp index 994c784..0801311 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -8,6 +8,7 @@ #include "net.h" #include "init.h" #include "util.h" +#include "ipcollector.h" #include "ui_interface.h" #include "checkpoints.h" #include @@ -37,7 +38,6 @@ enum Checkpoints::CPMode CheckpointsMode; // Ping and address broadcast intervals extern int64_t nPingInterval; -extern int64_t nBroadcastInterval; extern int64_t nReserveBalance; ////////////////////////////////////////////////////////////////////////////// @@ -292,6 +292,7 @@ std::string HelpMessage() " -rpcconnect= " + _("Send commands to node running on (default: 127.0.0.1)") + "\n" + " -blocknotify= " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" + + " -peercollector= " + _("Execute command to collect peer addresses") + "\n" + " -confchange " + _("Require a confirmations for change (default: 0)") + "\n" + " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool= " + _("Set key pool size to (default: 100)") + "\n" + @@ -374,13 +375,12 @@ bool AppInit2() // ********************************************************* Step 2: parameter interactions - nNodeLifespan = (unsigned int)(GetArg("-addrlifespan", 7)); + nNodeLifespan = GetArgUInt("-addrlifespan", 7); fUseFastIndex = GetBoolArg("-fastindex", true); fUseMemoryLog = GetBoolArg("-memorylog", true); // Ping and address broadcast intervals nPingInterval = max(10 * 60, GetArg("-keepalive", 30 * 60)); - nBroadcastInterval = max(6 * nOneHour, GetArg("-addrsetlifetime", nOneDay)); CheckpointsMode = Checkpoints::STRICT; std::string strCpMode = GetArg("-cppolicy", "strict"); @@ -778,8 +778,7 @@ bool AppInit2() strLoadError = _("Error loading block database"); break; } - } catch(std::exception &e) { - (void)e; + } catch(const std::exception&) { strLoadError = _("Error opening block database"); break; } @@ -997,7 +996,11 @@ bool AppInit2() if (fServer) NewThread(ThreadRPCServer, NULL); - // ********************************************************* Step 12: finished + // ********************************************************* Step 13: IP collection thread + strCollectorCommand = GetArg("-peercollector", ""); + if (!fTestNet && strCollectorCommand != "") + NewThread(ThreadIPCollector, NULL); + // ********************************************************* Step 14: finished uiInterface.InitMessage(_("Done loading")); printf("Done loading\n");