X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Finit.cpp;h=34cb698c6a059dea04f56b1331f11e9ff80840ba;hb=881c78620a35fbc93d3491c381f82f957a9f83f1;hp=483d27706361294ac6918950087ebf4184a923eb;hpb=77a43545b4491b9703d803765da9059d2bdd5aaa;p=novacoin.git diff --git a/src/init.cpp b/src/init.cpp index 483d277..34cb698 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -31,13 +31,16 @@ CClientUIInterface uiInterface; std::string strWalletFileName; bool fConfChange; unsigned int nNodeLifespan; -unsigned int nDerivationMethodIndex; unsigned int nMinerSleep; bool fUseFastIndex; bool fUseFastStakeMiner; bool fUseMemoryLog; enum Checkpoints::CPMode CheckpointsMode; +// Ping and address broadcast intervals +extern int64_t nPingInterval; +extern int64_t nBroadcastInterval; + ////////////////////////////////////////////////////////////////////////////// // // Shutdown @@ -374,19 +377,25 @@ bool AppInit2() fUseMemoryLog = GetBoolArg("-memorylog", true); nMinerSleep = GetArg("-minersleep", 500); + // Ping and address broadcast intervals + nPingInterval = max(10 * 60, GetArg("-keepalive", 30 * 60)); + + nBroadcastInterval = max(6 * 60 * 60, GetArg("-addrsetlifetime", 24 * 60 * 60)); + CheckpointsMode = Checkpoints::STRICT; std::string strCpMode = GetArg("-cppolicy", "strict"); - if(strCpMode == "strict") + if(strCpMode == "strict") { CheckpointsMode = Checkpoints::STRICT; + } - if(strCpMode == "advisory") + if(strCpMode == "advisory") { CheckpointsMode = Checkpoints::ADVISORY; + } - if(strCpMode == "permissive") + if(strCpMode == "permissive") { CheckpointsMode = Checkpoints::PERMISSIVE; - - nDerivationMethodIndex = 0; + } fTestNet = GetBoolArg("-testnet"); if (fTestNet) { @@ -499,7 +508,7 @@ bool AppInit2() // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log std::string strDataDir = GetDataDir().string(); - std::string strWalletFileName = GetArg("-wallet", "wallet.dat"); + strWalletFileName = GetArg("-wallet", "wallet.dat"); // strWalletFileName must be a plain filename without a directory if (strWalletFileName != boost::filesystem::basename(strWalletFileName) + boost::filesystem::extension(strWalletFileName))