Download params before creating zcash.conf
This commit is contained in:
@@ -74,8 +74,9 @@ void ConnectionLoader::loadConnection() {
|
|||||||
* This will create a new zcash.conf, download zcash parameters.
|
* This will create a new zcash.conf, download zcash parameters.
|
||||||
*/
|
*/
|
||||||
void ConnectionLoader::createZcashConf() {
|
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();
|
auto confLocation = zcashConfWritableLocation();
|
||||||
qDebug() << "Creating file " << confLocation;
|
qDebug() << "Creating file " << confLocation;
|
||||||
|
|
||||||
@@ -94,10 +95,9 @@ void ConnectionLoader::createZcashConf() {
|
|||||||
out << "rpcuser=zec-qt-wallet\n";
|
out << "rpcuser=zec-qt-wallet\n";
|
||||||
out << "rpcpassword=" % QString::number(std::rand()) << "\n";
|
out << "rpcpassword=" % QString::number(std::rand()) << "\n";
|
||||||
file.close();
|
file.close();
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch params. After params are fetched, try loading the connection again
|
this->loadConnection();
|
||||||
downloadParams([=] () { this->loadConnection(); });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionLoader::downloadParams(std::function<void(void)> cb) {
|
void ConnectionLoader::downloadParams(std::function<void(void)> cb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user