diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2014-06-27 14:41:11 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2014-07-09 09:22:36 +0200 |
commit | 00d1980b8fb8b834cb729b213834dfb38cb01bbf (patch) | |
tree | 98f15780a92e30e07c6b10cc0819a38340192839 | |
parent | 2ee918d1214d0027285bb7558c237888d6ee175b (diff) |
init.cpp: log fee estimates filename on error
- small changes to Shutdown(), buffer __func__, which is now used in
all LogPrintf() calls and format for better readability
- order using namespace alpabetically
-rw-r--r-- | src/init.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/init.cpp b/src/init.cpp index f9e568a207..a1d75c9674 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -38,8 +38,8 @@ #include <boost/interprocess/sync/file_lock.hpp> #include <openssl/crypto.h> -using namespace std; using namespace boost; +using namespace std; #ifdef ENABLE_WALLET CWallet* pwalletMain; @@ -109,10 +109,11 @@ static CCoinsViewDB *pcoinsdbview; void Shutdown() { - LogPrintf("Shutdown : In progress...\n"); + LogPrintf("%s: In progress...\n", __func__); static CCriticalSection cs_Shutdown; TRY_LOCK(cs_Shutdown, lockShutdown); - if (!lockShutdown) return; + if (!lockShutdown) + return; RenameThread("bitcoin-shutoff"); mempool.AddTransactionsUpdated(1); @@ -130,7 +131,7 @@ void Shutdown() if (est_fileout) mempool.WriteFeeEstimates(est_fileout); else - LogPrintf("failed to write fee estimates"); + LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); { LOCK(cs_main); @@ -142,9 +143,12 @@ void Shutdown() pblocktree->Flush(); if (pcoinsTip) pcoinsTip->Flush(); - delete pcoinsTip; pcoinsTip = NULL; - delete pcoinsdbview; pcoinsdbview = NULL; - delete pblocktree; pblocktree = NULL; + delete pcoinsTip; + pcoinsTip = NULL; + delete pcoinsdbview; + pcoinsdbview = NULL; + delete pblocktree; + pblocktree = NULL; } #ifdef ENABLE_WALLET if (pwalletMain) @@ -156,7 +160,7 @@ void Shutdown() if (pwalletMain) delete pwalletMain; #endif - LogPrintf("Shutdown : done\n"); + LogPrintf("%s: done\n", __func__); } // @@ -315,6 +319,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Node relay options:") + "\n"; strUsage += " -datacarrier " + _("Relay and mine data carrier transactions (default: 1)") + "\n"; + strUsage += "\n" + _("Block creation options:") + "\n"; strUsage += " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n"; strUsage += " -blockmaxsize=<n> " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n"; @@ -564,9 +569,9 @@ bool AppInit2(boost::thread_group& threadGroup) if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end()) fDebug = false; - // Check for -debugnet (deprecated) + // Check for -debugnet if (GetBoolArg("-debugnet", false)) - InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net")); + InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net.")); // Check for -socks - as this is a privacy risk to continue, exit here if (mapArgs.count("-socks")) return InitError(_("Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.")); @@ -994,6 +999,7 @@ bool AppInit2(boost::thread_group& threadGroup) boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_filein = CAutoFile(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); + // Allowed to fail as this file IS missing on first startup. if (est_filein) mempool.ReadFeeEstimates(est_filein); |