From f4091941f54d2273af68a9ed0cb467a627f90741 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 10 Jul 2016 21:10:02 -0600 Subject: [PATCH] Reorder initialization routines to ensure verifying key log messages appear in debug.log. --- src/init.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index f8183ace8..40b825b5c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -608,14 +608,14 @@ static void ZC_LoadParams() pzcashParams = ZCJoinSplit::Unopened(); - LogPrintf("Loading verification key from %s\n", vk_path.string().c_str()); + LogPrintf("Loading verifying key from %s\n", vk_path.string().c_str()); gettimeofday(&tv_start, 0); pzcashParams->loadVerifyingKey(vk_path.string()); gettimeofday(&tv_end, 0); elapsed = float(tv_end.tv_sec-tv_start.tv_sec) + (tv_end.tv_usec-tv_start.tv_usec)/float(1000000); - LogPrintf("Loaded verification key in %fs seconds.\n", elapsed); + LogPrintf("Loaded verifying key in %fs seconds.\n", elapsed); pzcashParams->setProvingKeyPath(pk_path.string()); } @@ -625,18 +625,6 @@ static void ZC_LoadParams() */ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) { - // Perform libsodium initialization - if (sodium_init() == -1) { - return false; - } - - // ********************************************************* Step 0: Load zcash params - ZC_LoadParams(); - // These must be disabled for now, they are buggy and we probably don't - // want any of libsnark's profiling in production anyway. - libsnark::inhibit_profiling_info = true; - libsnark::inhibit_profiling_counters = true; - // ********************************************************* Step 1: setup #ifdef _MSC_VER // Turn off Microsoft heap dump noise @@ -916,6 +904,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log + // Initialize libsodium + if (sodium_init() == -1) { + return false; + } + // Initialize elliptic curve code ECC_Start(); @@ -971,6 +964,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler); threadGroup.create_thread(boost::bind(&TraceThread, "scheduler", serviceLoop)); + // Initialize Zcash circuit parameters + ZC_LoadParams(); + // These must be disabled for now, they are buggy and we probably don't + // want any of libsnark's profiling in production anyway. + libsnark::inhibit_profiling_info = true; + libsnark::inhibit_profiling_counters = true; + /* Start the RPC server already. It will be started in "warmup" mode * and not really process calls already (but it will signify connections * that the server is there and will be ready later). Warmup mode will