Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
| Show First 20 Lines • Show All 1,680 Lines • ▼ Show 20 Lines | bool AppInitSanityChecks() { | ||||
| } | } | ||||
| // Probe the data directory lock to give an early error message, if possible | // Probe the data directory lock to give an early error message, if possible | ||||
| return LockDataDirectory(true); | return LockDataDirectory(true); | ||||
| } | } | ||||
| bool AppInitMain(Config &config, boost::thread_group &threadGroup, | bool AppInitMain(Config &config, boost::thread_group &threadGroup, | ||||
| CScheduler &scheduler) { | CScheduler &scheduler) { | ||||
| const CChainParams &chainparams = Params(); | const CChainParams &chainparams = config.GetChainParams(); | ||||
| // Step 4a: application initialization | // Step 4a: application initialization | ||||
| // After daemonization get the data directory lock again and hold on to it | // After daemonization get the data directory lock again and hold on to it | ||||
| // until exit. This creates a slight window for a race condition to happen, | // until exit. This creates a slight window for a race condition to happen, | ||||
| // however this condition is harmless: it will at most make us exit without | // however this condition is harmless: it will at most make us exit without | ||||
| // printing a message to console. | // printing a message to console. | ||||
| if (!LockDataDirectory(false)) { | if (!LockDataDirectory(false)) { | ||||
| // Detailed error printed inside LockDataDirectory | // Detailed error printed inside LockDataDirectory | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-server", false)) { | ||||
| _("Unable to start HTTP server. See debug log for details.")); | _("Unable to start HTTP server. See debug log for details.")); | ||||
| } | } | ||||
| } | } | ||||
| int64_t nStart; | int64_t nStart; | ||||
| // Step 5: verify wallet database integrity | // Step 5: verify wallet database integrity | ||||
| #ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
| if (!CWallet::Verify()) { | if (!CWallet::Verify(chainparams)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| #endif | #endif | ||||
| // Step 6: network initialization | // Step 6: network initialization | ||||
| // Note that we absolutely cannot open any actual connections | // Note that we absolutely cannot open any actual connections | ||||
| // until the very end ("start node") as the UTXO/block state | // until the very end ("start node") as the UTXO/block state | ||||
| // is not yet setup and may end up being set up twice if we | // is not yet setup and may end up being set up twice if we | ||||
| ▲ Show 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | #endif | ||||
| // Encoded addresses using cashaddr instead of base58 | // Encoded addresses using cashaddr instead of base58 | ||||
| // Activates by default on Jan, 14 | // Activates by default on Jan, 14 | ||||
| config.SetCashAddrEncoding( | config.SetCashAddrEncoding( | ||||
| gArgs.GetBoolArg("-usecashaddr", GetAdjustedTime() > 1515900000)); | gArgs.GetBoolArg("-usecashaddr", GetAdjustedTime() > 1515900000)); | ||||
| // Step 8: load wallet | // Step 8: load wallet | ||||
| #ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
| if (!CWallet::InitLoadWallet()) return false; | if (!CWallet::InitLoadWallet(chainparams)) return false; | ||||
| #else | #else | ||||
| LogPrintf("No wallet support compiled in!\n"); | LogPrintf("No wallet support compiled in!\n"); | ||||
| #endif | #endif | ||||
| // Step 9: data directory maintenance | // Step 9: data directory maintenance | ||||
| // if pruning, unset the service bit and perform the initial blockstore | // if pruning, unset the service bit and perform the initial blockstore | ||||
| // prune after any wallet rescanning has taken place. | // prune after any wallet rescanning has taken place. | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||