From b2fa525987455ff311b72bf7d7278b4ec0493efb Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 7 Nov 2018 21:40:57 -0800 Subject: [PATCH] Download params before creating zcash.conf --- src/connection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index f9af50c..231ed93 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -74,8 +74,9 @@ void ConnectionLoader::loadConnection() { * This will create a new zcash.conf, download zcash parameters. */ void ConnectionLoader::createZcashConf() { - // Create zcash.conf - { + // Fetch params. After params are fetched, create the zcash.conf file and + // try loading the connection again + downloadParams([=] () { auto confLocation = zcashConfWritableLocation(); qDebug() << "Creating file " << confLocation; @@ -94,10 +95,9 @@ void ConnectionLoader::createZcashConf() { out << "rpcuser=zec-qt-wallet\n"; out << "rpcpassword=" % QString::number(std::rand()) << "\n"; file.close(); - } - // Fetch params. After params are fetched, try loading the connection again - downloadParams([=] () { this->loadConnection(); }); + this->loadConnection(); + }); } void ConnectionLoader::downloadParams(std::function cb) {