diff options
| -rw-r--r-- | .github/verify_p2pool.py | 103 | ||||
| -rw-r--r-- | .github/workflows/verify_p2pool.yml | 16 | ||||
| -rw-r--r-- | Dockerfile.android | 18 | ||||
| -rw-r--r-- | Dockerfile.linux | 2 | ||||
| -rw-r--r-- | Dockerfile.windows | 2 | ||||
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | cmake/Deploy.cmake | 20 | ||||
| -rw-r--r-- | components/NetworkStatusItem.qml | 1 | ||||
| -rw-r--r-- | main.qml | 13 | ||||
| -rw-r--r-- | pages/Advanced.qml | 5 | ||||
| -rw-r--r-- | pages/History.qml | 17 | ||||
| -rw-r--r-- | pages/Mining.qml | 2 | ||||
| -rw-r--r-- | pages/Transfer.qml | 2 | ||||
| -rw-r--r-- | pages/settings/Settings.qml | 1 | ||||
| -rw-r--r-- | pages/settings/SettingsLog.qml | 2 | ||||
| -rw-r--r-- | pages/settings/SettingsNode.qml | 1 | ||||
| -rw-r--r-- | src/daemon/DaemonManager.cpp | 43 | ||||
| -rw-r--r-- | src/daemon/DaemonManager.h | 14 | ||||
| -rw-r--r-- | src/p2pool/P2PoolManager.cpp | 18 | ||||
| -rw-r--r-- | wizard/WizardModeSelection.qml | 2 |
20 files changed, 218 insertions, 72 deletions
diff --git a/.github/verify_p2pool.py b/.github/verify_p2pool.py new file mode 100644 index 00000000..051cf0b5 --- /dev/null +++ b/.github/verify_p2pool.py @@ -0,0 +1,103 @@ +import requests +import subprocess +from urllib.request import urlretrieve +import difflib + +sech_key = "https://p2pool.io/SChernykh.asc" +sech_key_backup = "https://raw.githubusercontent.com/monero-project/gitian.sigs/master/gitian-pubkeys/SChernykh.asc" +sech_key_fp = "1FCA AB4D 3DC3 310D 16CB D508 C47F 82B5 4DA8 7ADF" + +p2pool_files = [{ + "os": "WIN", + "filename": "windows-x64.zip", + }, + { + "os": "LINUX", + "filename": "linux-x64.tar.gz" + }, + { + "os": "MACOS", + "filename": "macos-x64.tar.gz", + }] + +def get_hash(fname): + fhash = subprocess.check_output(["sha256sum", fname]).decode("utf-8") + print(fhash.strip()) + return fhash.split()[0] + +def main(): + global p2pool_files, sech_key, sech_key_backup, sech_key_fp + p2pool_tag_api = "https://api.github.com/repos/SChernykh/p2pool/releases/latest" + data = requests.get(p2pool_tag_api).json() + tag = data["tag_name"] + head = f"p2pool-{tag}-" + url = f"https://github.com/SChernykh/p2pool/releases/download/{tag}/" + + try: + urlretrieve(sech_key,"SChernykh.asc") + except: + urlretrieve(sech_key_backup,"SChernykh.asc") + + urlretrieve(f"{url}sha256sums.txt.asc","sha256sums.txt.asc") + + subprocess.check_call(["gpg", "--import", "SChernykh.asc"]) + subprocess.check_call(["gpg", "--verify", "sha256sums.txt.asc"]) + fingerprint = subprocess.check_output(["gpg","--fingerprint", "SChernykh"]).decode("utf-8").splitlines()[1].strip() + + assert fingerprint == sech_key_fp + + with open("sha256sums.txt.asc","r") as f: + lines = f.readlines() + + signed_hashes = {} + for line in lines: + if "Name:" in line: + signed_fname = line.split()[1] + if "SHA256:" in line: + signed_hashes[signed_fname] = line.split()[1].lower() + + expected = "" + for i in range(len(p2pool_files)): + fname = p2pool_files[i]["filename"] + str_os =p2pool_files[i]["os"] + dl = f"{url}{head}{fname}" + urlretrieve(dl,f"{head}{fname}") + fhash = get_hash(f"{head}{fname}") + assert signed_hashes[f"{head}{fname}"] == fhash + if i == 0: + expected += f" #ifdef Q_OS_{str_os}\n" + else: + expected += f" #elif defined(Q_OS_{str_os})\n" + expected += f" url = \"https://github.com/SChernykh/p2pool/releases/download/{tag}/{head}{fname}\";\n" + expected += f" fileName = m_p2poolPath + \"/{head}{fname}\";\n" + expected += f" validHash = \"{fhash}\";\n" + expected += " #endif\n" + + print(f"Expected:\n{expected}") + + with open("src/p2pool/P2PoolManager.cpp","r") as f: + p2pool_lines = f.readlines() + + unexpected = "" + ignore = 1 + for line in p2pool_lines: + if ignore == 0: + unexpected += line + if "QString validHash;" in line: + ignore = 0 + if "#endif" in line and ignore == 0: + break + + d = difflib.Differ() + diff = d.compare(str(unexpected).splitlines(True),str(expected).splitlines(True)) + + print("Unexpected:") + for i in diff: + if i.startswith("?"): + continue + print(i.replace("\n","")) + + assert unexpected == expected + +if __name__ == "__main__": + main() diff --git a/.github/workflows/verify_p2pool.yml b/.github/workflows/verify_p2pool.yml new file mode 100644 index 00000000..c1653570 --- /dev/null +++ b/.github/workflows/verify_p2pool.yml @@ -0,0 +1,16 @@ +name: ci/gh-actions/verify +on: + push: + paths: + - 'src/p2pool/P2PoolManager.cpp' + pull_request: + paths: + - 'src/p2pool/P2PoolManager.cpp' +jobs: + p2pool-hashes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Verify Hashes + run: | + python3 .github/verify_p2pool.py diff --git a/Dockerfile.android b/Dockerfile.android index b077fb3f..0121f46f 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -5,12 +5,12 @@ ARG ANDROID_NDK_REVISION=21e ARG ANDROID_NDK_HASH=c3ebc83c96a4d7f539bd72c241b2be9dcd29bda9 ARG ANDROID_SDK_REVISION=7302050_latest ARG ANDROID_SDK_HASH=7a00faadc0864f78edd8f4908a629a46d622375cbe2e5814e82934aebecdb622 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl WORKDIR /opt/android ENV WORKDIR=/opt/android -ENV ANDROID_NATIVE_API_LEVEL=29 +ENV ANDROID_NATIVE_API_LEVEL=30 ENV ANDROID_API=android-${ANDROID_NATIVE_API_LEVEL} ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++ @@ -43,8 +43,8 @@ RUN echo y | ${ANDROID_SDK_ROOT}/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} " ENV HOST_PATH=${PATH} ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH} -ARG ZLIB_VERSION=1.2.12 -ARG ZLIB_HASH=91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9 +ARG ZLIB_VERSION=1.2.13 +ARG ZLIB_HASH=b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30 RUN wget -q https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz \ && echo "${ZLIB_HASH} zlib-${ZLIB_VERSION}.tar.gz" | sha256sum -c \ && tar -xzf zlib-${ZLIB_VERSION}.tar.gz \ @@ -206,6 +206,16 @@ RUN git clone -b v3.24.2 --depth 1 https://github.com/Kitware/CMake \ && PATH=${HOST_PATH} make -j${THREADS} install \ && rm -rf $(pwd) +RUN GRADLE_VERSION=5.6.4 \ + && GRADLE_HASH=1f3067073041bc44554d0efe5d402a33bc3d3c93cc39ab684f308586d732a80d \ + && wget -q https\://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip \ + && echo "${GRADLE_HASH} gradle-${GRADLE_VERSION}-bin.zip" | sha256sum -c \ + && GRADLE_LOCAL_PATH=gradle/wrapper/dists/gradle-${GRADLE_VERSION}-bin/bxirm19lnfz6nurbatndyydux \ + && mkdir -p ${GRADLE_LOCAL_PATH} \ + && mv gradle-${GRADLE_VERSION}-bin.zip ${GRADLE_LOCAL_PATH} + +ENV GRADLE_USER_HOME=${WORKDIR}/gradle + CMD set -ex \ && cd /monero-gui \ && mkdir -p build/Android/release \ diff --git a/Dockerfile.linux b/Dockerfile.linux index 442ffaf8..2dd02fb4 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,7 +1,7 @@ FROM ubuntu:16.04 ARG THREADS=1 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl ENV CFLAGS="-fPIC" ENV CPPFLAGS="-fPIC" diff --git a/Dockerfile.windows b/Dockerfile.windows index e302c8e5..abadcc75 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,7 +1,7 @@ FROM ubuntu:20.04 ARG THREADS=1 -ARG QT_VERSION=v5.15.6-lts-lgpl +ARG QT_VERSION=v5.15.7-lts-lgpl ENV SOURCE_DATE_EPOCH=1397818193 RUN apt update && \ @@ -221,15 +221,15 @@ Packaging for your favorite distribution would be a welcome contribution! 2. Install Qt: - *Note*: The Qt 5.9.7 or newer requirement makes **some** distributions (mostly based on debian, like Ubuntu 16.x or Linux Mint 18.x) obsolete due to their repositories containing an older Qt version. + *Note*: The Qt 5.9.7 or newer requirement makes **some** distributions (mostly based on Debian, like Ubuntu 16.x or Linux Mint 18.x) obsolete due to their repositories containing an older Qt version. The recommended way is to install 5.9.7 from the [official Qt installer](https://www.qt.io/download-qt-installer) or [compiling it yourself](https://wiki.qt.io/Install_Qt_5_on_Ubuntu). This ensures you have the correct version. Higher versions *can* work but as it differs from our production build target, slight differences may occur. The following instructions will fetch Qt from your distribution's repositories instead. Take note of what version it installs. Your mileage may vary. - - For Ubuntu 17.10+ + - For Debian distributions (Debian, Ubuntu, Mint, Tails...) - `sudo apt install qtbase5-dev qt5-default qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev` + `sudo apt install qtbase5-dev qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev` - For Gentoo @@ -240,7 +240,7 @@ The following instructions will fetch Qt from your distribution's repositories i - Optional : To build the flag `WITH_SCANNER` - - For Ubuntu + - For Debian distributions (Debian, Ubuntu, Mint, Tails...) `sudo apt install qtmultimedia5-dev qml-module-qtmultimedia` diff --git a/cmake/Deploy.cmake b/cmake/Deploy.cmake index bda241dd..f069996b 100644 --- a/cmake/Deploy.cmake +++ b/cmake/Deploy.cmake @@ -74,19 +74,19 @@ if(APPLE OR (WIN32 AND NOT STATIC)) ) if(CMAKE_BUILD_TYPE STREQUAL "Debug") list(APPEND WIN_DEPLOY_DLLS - libicudtd71.dll - libicuind71.dll - libicuiod71.dll - libicutud71.dll - libicuucd71.dll + libicudtd72.dll + libicuind72.dll + libicuiod72.dll + libicutud72.dll + libicuucd72.dll ) else() # assume release list(APPEND WIN_DEPLOY_DLLS - libicudt71.dll - libicuin71.dll - libicuio71.dll - libicutu71.dll - libicuuc71.dll + libicudt72.dll + libicuin72.dll + libicuio72.dll + libicutu72.dll + libicuuc72.dll ) endif() list(TRANSFORM WIN_DEPLOY_DLLS PREPEND "$ENV{MSYSTEM_PREFIX}/bin/") diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index 48eeccc2..46e9fbd6 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -201,6 +201,7 @@ Rectangle { daemonManager.sendCommandAsync( ["set_bootstrap_daemon", "auto"], appWindow.currentWallet.nettype, + persistentSettings.blockchainDataDir, callback); refreshMouseArea.visible = false; @@ -94,7 +94,7 @@ ApplicationWindow { readonly property string localDaemonAddress : "localhost:" + getDefaultDaemonRpcPort(persistentSettings.nettype) property string currentDaemonAddress; property int disconnectedEpoch: 0 - property int estimatedBlockchainSize: persistentSettings.pruneBlockchain ? 40 : 105 // GB + property int estimatedBlockchainSize: persistentSettings.pruneBlockchain ? 55 : 150 // GB property alias viewState: rootItem.state property string prevSplashText; property bool splashDisplayedBeforeButtonRequest; @@ -469,7 +469,7 @@ ApplicationWindow { // If wallet isnt connected, advanced wallet mode and no daemon is running - Ask if (appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode && !walletInitialized && disconnected) { - daemonManager.runningAsync(persistentSettings.nettype, function(running) { + daemonManager.runningAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, function(running) { if (!running) { daemonManagerDialog.open(); } @@ -694,7 +694,8 @@ ApplicationWindow { // Daemon connected leftPanel.networkStatus.connected = currentWallet ? currentWallet.connected() : Wallet.ConnectionStatus_Disconnected - currentWallet.refreshHeightAsync(); + if (currentWallet) + currentWallet.refreshHeightAsync(); } function startDaemon(flags){ @@ -714,7 +715,7 @@ ApplicationWindow { appWindow.showProcessingSplash(qsTr("Waiting for daemon to stop...")); } p2poolManager.exit() - daemonManager.stopAsync(persistentSettings.nettype, function(result) { + daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, function(result) { daemonStartStopInProgress = 0; if (splash) { hideProcessingSplash(); @@ -1396,7 +1397,7 @@ ApplicationWindow { property bool historyShowAdvanced: false property bool historyHumanDates: true property string blockchainDataDir: "" - property bool useRemoteNode: false + property bool useRemoteNode: isAndroid property string remoteNodeAddress: "" // TODO: drop after v0.17.2.0 release property string remoteNodesSerialized: JSON.stringify({ selected: 0, @@ -2142,7 +2143,7 @@ ApplicationWindow { if (currentWallet) { handler(!currentWallet.disconnected); } else { - daemonManager.runningAsync(persistentSettings.nettype, handler); + daemonManager.runningAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, handler); } } } diff --git a/pages/Advanced.qml b/pages/Advanced.qml index 17904e3b..68896079 100644 --- a/pages/Advanced.qml +++ b/pages/Advanced.qml @@ -53,6 +53,7 @@ ColumnLayout { active: state == "Mining" text: qsTr("Mining") + translationManager.emptyString onSelected: state = "Mining" + visible: !isAndroid } MoneroComponents.NavbarItem { active: state == "Prove" @@ -82,7 +83,7 @@ ColumnLayout { Layout.fillWidth: true Layout.preferredHeight: panelHeight color: "transparent" - state: "Mining" + state: isAndroid ? "Prove" : "Mining" onCurrentViewChanged: { if (previousView) { @@ -121,7 +122,7 @@ ColumnLayout { StackView { id: stackView - initialItem: stateView.miningView + initialItem: isAndroid ? stateView.prooveView : stateView.miningView anchors.fill: parent clip: false // otherwise animation will affect left panel diff --git a/pages/History.qml b/pages/History.qml index 48befeaa..88a2b767 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -1765,18 +1765,25 @@ Rectangle { var written = currentWallet.history.writeCSV(currentWallet.currentSubaddressAccount, dataDir); if(written !== ""){ - informationPopup.title = qsTr("Success") + translationManager.emptyString; + confirmationDialog.title = qsTr("Success") + translationManager.emptyString; var text = qsTr("CSV file written to: %1").arg(written) + "\n\n" text += qsTr("Tip: Use your favorite spreadsheet software to sort on blockheight.") + "\n\n" + translationManager.emptyString; - informationPopup.text = text; - informationPopup.icon = StandardIcon.Information; + confirmationDialog.text = text; + confirmationDialog.icon = StandardIcon.Information; + confirmationDialog.cancelText = qsTr("Open folder") + translationManager.emptyString; + confirmationDialog.onAcceptedCallback = null; + confirmationDialog.onRejectedCallback = function() { + oshelper.openContainingFolder(written); + } + confirmationDialog.open(); } else { informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Error exporting transaction data.") + "\n\n" + translationManager.emptyString; informationPopup.icon = StandardIcon.Critical; + informationPopup.onCloseCallback = null; + informationPopup.open(); + } - informationPopup.onCloseCallback = null; - informationPopup.open(); } Component.onCompleted: { var _folder = 'file://' + appWindow.accountsDir; diff --git a/pages/Mining.qml b/pages/Mining.qml index 8d5a2522..e9ab1d07 100644 --- a/pages/Mining.qml +++ b/pages/Mining.qml @@ -297,7 +297,7 @@ Rectangle { startP2Pool() } else { - daemonManager.stopAsync(persistentSettings.nettype, startP2PoolLocal) + daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, startP2PoolLocal) } } else { diff --git a/pages/Transfer.qml b/pages/Transfer.qml index a768538d..5719c744 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -51,7 +51,7 @@ Rectangle { color: "transparent" property alias transferHeight1: pageRoot.height property alias transferHeight2: advancedLayout.height - property int mixin: 10 // (ring size 11) + property int mixin: 15 // (ring size 16) property string warningContent: "" property string sendButtonWarning: { // Currently opened wallet is not view-only diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml index fdf03ce6..414b61a1 100644 --- a/pages/settings/Settings.qml +++ b/pages/settings/Settings.qml @@ -74,6 +74,7 @@ ColumnLayout { active: settingsStateView.state == "Log" text: qsTr("Log") + translationManager.emptyString onSelected: settingsStateView.state = "Log" + visible: !isAndroid } MoneroComponents.NavbarItem { active: settingsStateView.state == "Info" diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 4c393ee9..d11201b0 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -254,7 +254,7 @@ Rectangle { onAccepted: { if(text.length > 0) { consoleArea.logCommand(">>> " + text) - daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, function(result) { + daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, persistentSettings.blockchainDataDir, function(result) { if (!result) { appWindow.showStatusMessage(qsTr("Failed to send command"), 3); } diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index ab3d49f1..e0ae009a 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -55,6 +55,7 @@ Rectangle{ Layout.fillWidth: true Layout.preferredHeight: 90 color: "transparent" + visible: !isAndroid Rectangle { id: localNodeDivider diff --git a/src/daemon/DaemonManager.cpp b/src/daemon/DaemonManager.cpp index ad8bab16..6a5a8233 100644 --- a/src/daemon/DaemonManager.cpp +++ b/src/daemon/DaemonManager.cpp @@ -130,8 +130,8 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const } // Start start watcher - m_scheduler.run([this, nettype, noSync] { - if (startWatcher(nettype)) { + m_scheduler.run([this, nettype, dataDir, noSync] { + if (startWatcher(nettype, dataDir)) { emit daemonStarted(); m_noSync = noSync; } else { @@ -142,13 +142,13 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const return true; } -void DaemonManager::stopAsync(NetworkType::Type nettype, const QJSValue& callback) +void DaemonManager::stopAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) { - const auto feature = m_scheduler.run([this, nettype] { + const auto feature = m_scheduler.run([this, nettype, dataDir] { QString message; - sendCommand({"exit"}, nettype, message); + sendCommand({"exit"}, nettype, dataDir, message); - return QJSValueList({stopWatcher(nettype)}); + return QJSValueList({stopWatcher(nettype, dataDir)}); }, callback); if (!feature.first) @@ -157,14 +157,14 @@ void DaemonManager::stopAsync(NetworkType::Type nettype, const QJSValue& callbac } } -bool DaemonManager::startWatcher(NetworkType::Type nettype) const +bool DaemonManager::startWatcher(NetworkType::Type nettype, const QString &dataDir) const { // Check if daemon is started every 2 seconds QElapsedTimer timer; timer.start(); while(true && !m_app_exit && timer.elapsed() / 1000 < DAEMON_START_TIMEOUT_SECONDS ) { QThread::sleep(2); - if(!running(nettype)) { + if(!running(nettype, dataDir)) { qDebug() << "daemon not running. checking again in 2 seconds."; } else { qDebug() << "daemon is started. Waiting 5 seconds to let daemon catch up"; @@ -175,14 +175,14 @@ bool DaemonManager::startWatcher(NetworkType::Type nettype) const return false; } -bool DaemonManager::stopWatcher(NetworkType::Type nettype) const +bool DaemonManager::stopWatcher(NetworkType::Type nettype, const QString &dataDir) const { // Check if daemon is running every 2 seconds. Kill if still running after 10 seconds int counter = 0; while(true && !m_app_exit) { QThread::sleep(2); counter++; - if(running(nettype)) { + if(running(nettype, dataDir)) { qDebug() << "Daemon still running. " << counter; if(counter >= 5) { qDebug() << "Killing it! "; @@ -236,10 +236,10 @@ void DaemonManager::printError() } } -bool DaemonManager::running(NetworkType::Type nettype) const +bool DaemonManager::running(NetworkType::Type nettype, const QString &dataDir) const { QString status; - sendCommand({"sync_info"}, nettype, status); + sendCommand({"sync_info"}, nettype, dataDir, status); qDebug() << status; return status.contains("Height:"); } @@ -249,14 +249,14 @@ bool DaemonManager::noSync() const noexcept return m_noSync; } -void DaemonManager::runningAsync(NetworkType::Type nettype, const QJSValue& callback) const +void DaemonManager::runningAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const { - m_scheduler.run([this, nettype] { - return QJSValueList({running(nettype)}); + m_scheduler.run([this, nettype, dataDir] { + return QJSValueList({running(nettype, dataDir)}); }, callback); } -bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettype, QString &message) const +bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, QString &message) const { QProcess p; QStringList external_cmd(cmd); @@ -267,6 +267,11 @@ bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettyp else if (nettype == NetworkType::STAGENET) external_cmd << "--stagenet"; + // Custom data-dir + if (!dataDir.isEmpty()) { + external_cmd << "--data-dir" << dataDir; + } + qDebug() << "sending external cmd: " << external_cmd; @@ -278,11 +283,11 @@ bool DaemonManager::sendCommand(const QStringList &cmd, NetworkType::Type nettyp return started; } -void DaemonManager::sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QJSValue& callback) const +void DaemonManager::sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const { - m_scheduler.run([this, cmd, nettype] { + m_scheduler.run([this, cmd, nettype, dataDir] { QString message; - return QJSValueList({sendCommand(cmd, nettype, message)}); + return QJSValueList({sendCommand(cmd, nettype, dataDir, message)}); }, callback); } diff --git a/src/daemon/DaemonManager.h b/src/daemon/DaemonManager.h index 2f884665..5a48a489 100644 --- a/src/daemon/DaemonManager.h +++ b/src/daemon/DaemonManager.h @@ -48,23 +48,23 @@ public: ~DaemonManager(); Q_INVOKABLE bool start(const QString &flags, NetworkType::Type nettype, const QString &dataDir = "", const QString &bootstrapNodeAddress = "", bool noSync = false, bool pruneBlockchain = false); - Q_INVOKABLE void stopAsync(NetworkType::Type nettype, const QJSValue& callback); + Q_INVOKABLE void stopAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback); Q_INVOKABLE bool noSync() const noexcept; // return true if daemon process is started - Q_INVOKABLE void runningAsync(NetworkType::Type nettype, const QJSValue& callback) const; + Q_INVOKABLE void runningAsync(NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const; // Send daemon command from qml and prints output in console window. - Q_INVOKABLE void sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QJSValue& callback) const; + Q_INVOKABLE void sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, const QJSValue& callback) const; Q_INVOKABLE void exit(); Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const; Q_INVOKABLE bool checkLmdbExists(QString datadir); private: - bool running(NetworkType::Type nettype) const; - bool sendCommand(const QStringList &cmd, NetworkType::Type nettype, QString &message) const; - bool startWatcher(NetworkType::Type nettype) const; - bool stopWatcher(NetworkType::Type nettype) const; + bool running(NetworkType::Type nettype, const QString &dataDir) const; + bool sendCommand(const QStringList &cmd, NetworkType::Type nettype, const QString &dataDir, QString &message) const; + bool startWatcher(NetworkType::Type nettype, const QString &dataDir) const; + bool stopWatcher(NetworkType::Type nettype, const QString &dataDir) const; signals: void daemonStarted() const; void daemonStopped() const; diff --git a/src/p2pool/P2PoolManager.cpp b/src/p2pool/P2PoolManager.cpp index f1b8c269..575f6d41 100644 --- a/src/p2pool/P2PoolManager.cpp +++ b/src/p2pool/P2PoolManager.cpp @@ -49,17 +49,17 @@ void P2PoolManager::download() { QString fileName; QString validHash; #ifdef Q_OS_WIN - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-windows-x64.zip"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-windows-x64.zip"; - validHash = "06b6fe302600c959007bf94e7a5b445f45f823dc4e43ae6cf03b3b98a805167a"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-windows-x64.zip"; + fileName = m_p2poolPath + "/p2pool-v2.6-windows-x64.zip"; + validHash = "9b5aabd1194c7e5cb5ade81f7763a68c49658f4e2a4726994e8106ee2db20cff"; #elif defined(Q_OS_LINUX) - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-linux-x64.tar.gz"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-linux-x64.tar.gz"; - validHash = "02f1daea0f8f99076b7da3368a43cc3989b800f8b5afaf4dfc7e8f9bdc27d274"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-linux-x64.tar.gz"; + fileName = m_p2poolPath + "/p2pool-v2.6-linux-x64.tar.gz"; + validHash = "28f55976022e78e8a2ca87b7ac0b9582d665527b399f4f48a3f4045129ca5fa3"; #elif defined(Q_OS_MACOS) - url = "https://github.com/SChernykh/p2pool/releases/download/v2.2.1/p2pool-v2.2.1-macos-x64.tar.gz"; - fileName = m_p2poolPath + "/p2pool-v2.2.1-macos-x64.tar.gz"; - validHash = "d973a8dca922f209dfb6f203006f93664e19d870975621bec07e9d855e79d7d5"; + url = "https://github.com/SChernykh/p2pool/releases/download/v2.6/p2pool-v2.6-macos-x64.tar.gz"; + fileName = m_p2poolPath + "/p2pool-v2.6-macos-x64.tar.gz"; + validHash = "af7d35946ea0be00e78ed16aaaed10d2fe6d5b3064d284eddf80e15f207e1962"; #endif QFile file(fileName); epee::net_utils::http::http_simple_client http_client; diff --git a/wizard/WizardModeSelection.qml b/wizard/WizardModeSelection.qml index 5411735c..eb6b36d4 100644 --- a/wizard/WizardModeSelection.qml +++ b/wizard/WizardModeSelection.qml @@ -41,7 +41,7 @@ Rectangle { property alias pageHeight: pageRoot.height property string viewName: "wizardModeSelection1" property bool portable: persistentSettings.portable - property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0 + property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0 && !isAndroid function applyWalletMode(mode, wizardState) { if (!persistentSettings.setPortable(portable)) { |
