From 4470c4fe096689f6381b42c89b42c63044895289 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 24 Nov 2019 09:12:15 -0800 Subject: [PATCH] Fix some bugs in mac param support --- src/connection.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index b11f591..0eda0fc 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -215,13 +215,13 @@ void ConnectionLoader::createZcashConf() { } -void ConnectionLoader::downloadParams(std::function cb) { +void ConnectionLoader::downloadParams(std::function cb) { main->logger->write("Adding params to download queue"); // Add all the files to the download queue downloadQueue = new QQueue(); client = new QNetworkAccessManager(main); - //TODO: we never execute this + //Currently we fallback to this in rare edgecases, it's not normally executed downloadQueue->enqueue(QUrl("https://z.cash/downloads/sapling-output.params")); downloadQueue->enqueue(QUrl("https://z.cash/downloads/sapling-spend.params")); @@ -609,9 +609,15 @@ bool ConnectionLoader::verifyParams() { return true; } - // this is to support hushd inside a .dmg file, where the binaries are not at the root directory, but they are executed from the root dir of the .dmg - if( QFile( QDir("..").filePath("./silentdragon.app/Contents/MacOS/sapling-output.params") ).exists() && QFile( QDir("..").filePath("./silentdragon.app/Contents/MacOS/hush3/sapling-spend.params") ).exists() ) { - qDebug() << "Found params in ../silentdragon.app/Contents/MacOS"; + // this is to support SD on mac in /Applications1 + if( QFile( QDir("/Applications").filePath("silentdragon.app/Contents/MacOS/sapling-output.params") ).exists() && QFile( QDir("/Applications").filePath("./silentdragon.app/Contents/MacOS/sapling-spend.params") ).exists() ) { + qDebug() << "Found params in /Applications/silentdragon.app/Contents/MacOS"; + return true; + } + + // this is to support SD on mac inside a DMG + if( QFile( QDir("./").filePath("silentdragon.app/Contents/MacOS/sapling-output.params") ).exists() && QFile( QDir("./").filePath("./silentdragon.app/Contents/MacOS/sapling-spend.params") ).exists() ) { + qDebug() << "Found params in ./silentdragon.app/Contents/MacOS"; return true; }