From f9c55f82aae3ce27cedc9801389a19ab561cc877 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 17 Sep 2024 16:10:19 +0200 Subject: [PATCH 01/76] ci: print hashes, draft release --- .github/workflows/guix.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/guix.yml b/.github/workflows/guix.yml index 8418f2d..68fc141 100644 --- a/.github/workflows/guix.yml +++ b/.github/workflows/guix.yml @@ -80,7 +80,16 @@ jobs: - uses: actions/download-artifact@v4 with: merge-multiple: true + - name: print hashes + run: | + uname --machine && find **/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum >> $GITHUB_STEP_SUMMARY - uses: actions/upload-artifact@v4 with: name: "logs" path: '**/logs/**' + - uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + artifacts: "**/*.AppImage,**/*-linux-arm.zip,**/*-linux-arm64.zip,**/*-linux-riscv64.zip,**/*-linux.zip,**/*-mac-arm64.zip,**/*-mac.zip,**/*-win.zip,**/FeatherWalletSetup-*.exe,**/feather-{{github.ref_name}}.tar.gz" + draft: true + name: v${{github.ref_name}} From bff194a2112ccbd6b2c30a2eb3143fa7323e866b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 19 Sep 2024 14:01:19 +0200 Subject: [PATCH 02/76] node: consider .local tld local --- src/utils/nodes.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/nodes.h b/src/utils/nodes.h index 27c2897..920fda9 100644 --- a/src/utils/nodes.h +++ b/src/utils/nodes.h @@ -78,6 +78,10 @@ struct FeatherNode { return true; } + if (host.endsWith(".local")) { // RFC 6762 + return true; + } + QHostAddress address(host); bool validipv4; From 60dde9b9ee56312a3e9d5f072bae239518a52acf Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 21 Sep 2024 21:46:19 +0200 Subject: [PATCH 03/76] nodes: remove dead i2p nodes, add ofrnxmr --- src/assets/nodes.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/assets/nodes.json b/src/assets/nodes.json index a13e3ce..671c7cd 100644 --- a/src/assets/nodes.json +++ b/src/assets/nodes.json @@ -21,10 +21,7 @@ "rucknium757bokwv3ss35ftgc3gzb7hgbvvglbg3hisp7tsj2fkd2nyd.onion:18081" ], "i2p": [ - "ynk3hrwte23asonojqeskoulek2g2cd6tqg4neghnenfyljrvhga.b32.i2p:18081", - "t7lce3j7mwxt32h755u3njjp3k6og3defgueo3iecgsexxnkoezouobc.b32.i2p:18089", - "ecnfc7oyzzw3jmwc2omxzccbik33wyyaofxsfow7342z6kjanq6a.b32.i2p:18089", - "xmp3afekvuhbmzxl2bgj6ju23d6feqpumxuzdqzq4aysbijohdxa.b32.i2p:18089" + "ofrnxmr5ltaazarexs3damrcsldc5p6qlcos3vk25cwdgyjvrueq.b32.i2p:18089" ], "clearnet": [ "node.community.rino.io:18081", From 26f303ea479650372d873b1fb26278014b08df93 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 22 Sep 2024 13:37:06 +0200 Subject: [PATCH 04/76] macos: disable SingleApplication --- src/CMakeLists.txt | 11 ++++++++--- src/main.cpp | 14 +++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae06ddb..9234e06 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,8 +20,10 @@ endif() find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS}) -set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") -add_subdirectory(third-party/singleapplication) +if (NOT APPLE) + set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") + add_subdirectory(third-party/singleapplication) +endif() if (CHECK_UPDATES) add_subdirectory(openpgp) @@ -272,13 +274,16 @@ target_link_libraries(feather PRIVATE Threads::Threads ${QRENCODE_LIBRARY} ${POLYSEED_LIBRARY} - SingleApplication::SingleApplication ${ICU_LIBRARIES} ${LIBZIP_LIBRARIES} ${ZLIB_LIBRARIES} ${BCUR_LIBRARY} ) +if(NOT APPLE) + target_link_libraries(feather PRIVATE SingleApplication::SingleApplication) +endif() + if(CHECK_UPDATES) target_link_libraries(feather PRIVATE openpgp) endif() diff --git a/src/main.cpp b/src/main.cpp index 8d1e406..43a9e72 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,9 @@ #include #include #include +#if !defined(Q_OS_MAC) #include +#endif #include "config-feather.h" #include "constants.h" @@ -64,6 +66,8 @@ void signal_handler(int signum) { int main(int argc, char *argv[]) { + qDebug() << "Reached main"; + Q_INIT_RESOURCE(assets); #if defined(Q_OS_LINUX) && defined(STACK_TRACE) @@ -131,12 +135,18 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); #endif + qDebug() << "Setting up QApplication"; + +#if defined(Q_OS_MAC) + // https://github.com/itay-grudev/SingleApplication/issues/136#issuecomment-1925441403 + QApplication app(argc, argv); +#else SingleApplication app(argc, argv); +#endif QApplication::setQuitOnLastWindowClosed(false); QApplication::setApplicationName("FeatherWallet"); - // Setup config directories QString configDir = Config::defaultConfigDir().path(); QString config_dir_tor = QString("%1/%2").arg(configDir, "tor"); @@ -238,9 +248,11 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { auto wm = windowManager(); wm->setEventFilter(&filter); +#if !defined(Q_OS_MAC) QObject::connect(&app, &SingleApplication::instanceStarted, [&wm]() { wm->raise(); }); +#endif return QApplication::exec(); } From d67d54cd6c5cb7e32f39f72d936f99137d232755 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 22 Sep 2024 19:12:49 +0200 Subject: [PATCH 05/76] nodes: remove dead nodes --- src/assets/nodes.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/assets/nodes.json b/src/assets/nodes.json index 671c7cd..296aa66 100644 --- a/src/assets/nodes.json +++ b/src/assets/nodes.json @@ -3,8 +3,6 @@ "tor": [ "sfprpc2fws6ltnq4hyr7lvpul3nank5layd7q7tyc5h4gy4h77gtabad.onion:18089", "moneroxmrxw44lku6qniyarpwgznpcwml4drq7vb24ppatlcg4kmxpqd.onion:18089", - "6dsdenp6vjkvqzy4wzsnzn6wixkdzihx3khiumyzieauxuxslmcaeiad.onion:18081", - "56wl7y2ebhamkkiza4b7il4mrzwtyvpdym7bm2bkg3jrei2je646k3qd.onion:18089", "ip4zpbps7unk6xhlanqtw24f75akfbl3upeckfjqjks7ftfnk4i73oid.onion:18081", "mhfsxznn5pi4xuxohj5k7unqp73sa6d44mbeewbpxnm25z3wzfogcfyd.onion:18081", "7inib34hqn2ocmlaaxjshdavbdn5w5rfdff735lbz33765j2pz3tn4ad.onion:18081", From aedb555ceb40b613a4dcbb7d7289df00378c3d80 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 22 Sep 2024 21:19:20 +0200 Subject: [PATCH 06/76] wizard: mention official site on menu --- src/wizard/PageMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wizard/PageMenu.cpp b/src/wizard/PageMenu.cpp index 6292645..ac33769 100644 --- a/src/wizard/PageMenu.cpp +++ b/src/wizard/PageMenu.cpp @@ -18,7 +18,7 @@ PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget ui->setupUi(this); this->setButtonText(QWizard::FinishButton, "Open recent wallet"); - ui->label_version->setText(QString("Feather %1 — by dsc & tobtoht").arg(FEATHER_VERSION)); + ui->label_version->setText(QString("Feather %1 — by featherwallet.org").arg(FEATHER_VERSION)); QString settingsSkin = conf()->get(Config::skin).toString(); } From bb5c855902e20e67eccffaa177c4684271f006c4 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 Sep 2024 13:04:32 +0200 Subject: [PATCH 07/76] depends: libzip: update to 1.11.1 --- contrib/depends/packages/libzip.mk | 30 ++++++++++++++----- .../depends/patches/libzip/no-clonefile.patch | 10 ------- 2 files changed, 23 insertions(+), 17 deletions(-) delete mode 100644 contrib/depends/patches/libzip/no-clonefile.patch diff --git a/contrib/depends/packages/libzip.mk b/contrib/depends/packages/libzip.mk index 79f5f65..3b2b0d4 100644 --- a/contrib/depends/packages/libzip.mk +++ b/contrib/depends/packages/libzip.mk @@ -1,17 +1,33 @@ package=libzip -$(package)_version=1.10.1 +$(package)_version=1.11.1 $(package)_download_path=https://libzip.org/download/ -$(package)_file_name=$(package)-$($(package)_version).tar.xz -$(package)_sha256_hash=dc3c8d5b4c8bbd09626864f6bcf93de701540f761d76b85d7c7d710f4bd90318 +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=c0e6fa52a62ba11efd30262290dc6970947aef32e0cc294ee50e9005ceac092a $(package)_dependencies=zlib -$(package)_patches += no-clonefile.patch + +define $(package)_set_vars + $(package)_config_opts := -DENABLE_BZIP2=OFF + $(package)_config_opts += -DENABLE_LZMA=OFF + $(package)_config_opts += -DENABLE_ZSTD=OFF + $(package)_config_opts += -DENABLE_COMMONCRYPTO=OFF + $(package)_config_opts += -DENABLE_GNUTLS=OFF + $(package)_config_opts += -DENABLE_MBEDTLS=OFF + $(package)_config_opts += -DENABLE_OPENSSL=OFF + $(package)_config_opts += -DENABLE_WINDOWS_CRYPTO=OFF + $(package)_config_opts += -DBUILD_SHARED_LIBS=OFF + $(package)_config_opts += -DBUILD_TOOLS=OFF + $(package)_config_opts += -DBUILD_REGRESS=OFF + $(package)_config_opts += -DBUILD_OSSFUZZ=OFF + $(package)_config_opts += -DBUILD_EXAMPLES=OFF + $(package)_config_opts += -DBUILD_DOC=OFF +endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/no-clonefile.patch + rm -rf regress ossfuzz endef define $(package)_config_cmds - $($(package)_cmake) -DZLIB_ROOT=$(host_prefix) -DENABLE_BZIP2=Off -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$(host_prefix) . + $($(package)_cmake) . endef define $(package)_build_cmds @@ -20,4 +36,4 @@ endef define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef \ No newline at end of file +endef diff --git a/contrib/depends/patches/libzip/no-clonefile.patch b/contrib/depends/patches/libzip/no-clonefile.patch deleted file mode 100644 index 9848680..0000000 --- a/contrib/depends/patches/libzip/no-clonefile.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -99,7 +99,6 @@ check_function_exists(_strtoi64 HAVE__STRTOI64) - check_function_exists(_strtoui64 HAVE__STRTOUI64) - check_function_exists(_unlink HAVE__UNLINK) - check_function_exists(arc4random HAVE_ARC4RANDOM) --check_function_exists(clonefile HAVE_CLONEFILE) - check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO) - check_function_exists(explicit_memset HAVE_EXPLICIT_MEMSET) - check_function_exists(fchmod HAVE_FCHMOD) From 9449552d0eabc4361306cea0cc4feff6bac6d7d6 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 Sep 2024 14:25:16 +0200 Subject: [PATCH 08/76] depends: expat: update to 2.6.3 --- contrib/depends/packages/expat.mk | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/contrib/depends/packages/expat.mk b/contrib/depends/packages/expat.mk index 1d69bb6..24f34c4 100644 --- a/contrib/depends/packages/expat.mk +++ b/contrib/depends/packages/expat.mk @@ -1,21 +1,20 @@ package=expat -$(package)_version=2.6.2 +$(package)_version=2.6.3 $(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/ -$(package)_file_name=$(package)-$($(package)_version).tar.xz -$(package)_sha256_hash=ee14b4c5d8908b1bec37ad937607eab183d4d9806a08adee472c3c3121d27364 +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=17aa6cfc5c4c219c09287abfc10bc13f0c06f30bb654b28bfe6f567ca646eb79 +$(package)_build_subdir=build -# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional -# definitions in endian.h, which are required for a working -# endianess check in configure when building with -flto. define $(package)_set_vars - $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples - $(package)_config_opts += --disable-dependency-tracking --enable-option-checking - $(package)_config_opts += --without-xmlwf --with-pic - $(package)_cppflags += -D_DEFAULT_SOURCE + $(package)_config_opts := -DEXPAT_BUILD_TOOLS=OFF + $(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF + $(package)_config_opts += -DEXPAT_BUILD_TESTS=OFF + $(package)_config_opts += -DBUILD_SHARED_LIBS=OFF + $(package)_config_opts += -DCMAKE_POSITION_INDEPENDENT_CODE=ON endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -27,5 +26,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf share lib/cmake lib/*.la -endef \ No newline at end of file + rm -rf share lib/cmake +endef From 90689980ded799a014cbceff24c4f2ec81d2ef1c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 Sep 2024 15:14:36 +0200 Subject: [PATCH 09/76] depends: libxcb_util_cursor: update to 0.1.5 --- contrib/depends/packages/libxcb_util_cursor.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/depends/packages/libxcb_util_cursor.mk b/contrib/depends/packages/libxcb_util_cursor.mk index f5bc568..ef2b66c 100644 --- a/contrib/depends/packages/libxcb_util_cursor.mk +++ b/contrib/depends/packages/libxcb_util_cursor.mk @@ -1,12 +1,12 @@ package=libxcb_util_cursor -$(package)_version=0.1.4 +$(package)_version=0.1.5 $(package)_download_path=https://xcb.freedesktop.org/dist $(package)_file_name=xcb-util-cursor-$($(package)_version).tar.gz -$(package)_sha256_hash=cc8608ebb695742b6cf84712be29b2b66aa5f6768039528794fca0fa283022bf +$(package)_sha256_hash=0e9c5446dc6f3beb8af6ebfcc9e27bcc6da6fe2860f7fc07b99144dfa568e93b $(package)_dependencies=libxcb libxcb_util_render libxcb_util_image define $(package)_set_vars -$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen +$(package)_config_opts := --disable-shared --disable-devel-docs --without-doxygen $(package)_config_opts += --disable-dependency-tracking --enable-option-checking endef From 89f40389b19018a08904af0a33d22a8e1ab0c3fa Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 24 Sep 2024 15:25:22 +0200 Subject: [PATCH 10/76] depends: freetype: update to 2.13.3 --- contrib/depends/packages/freetype.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/depends/packages/freetype.mk b/contrib/depends/packages/freetype.mk index 9c3966e..2aa2230 100644 --- a/contrib/depends/packages/freetype.mk +++ b/contrib/depends/packages/freetype.mk @@ -1,18 +1,20 @@ package=freetype -$(package)_version=2.13.2 +$(package)_version=2.13.3 $(package)_download_path=https://sourceforge.net/projects/freetype/files/freetype2/$($(package)_version)/ -$(package)_file_name=freetype-$($(package)_version).tar.xz -$(package)_sha256_hash=12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d +$(package)_file_name=freetype-$($(package)_version).tar.gz +$(package)_sha256_hash=5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 define $(package)_set_vars - $(package)_config_opts = --without-zlib --without-png --without-harfbuzz --without-bzip2 --enable-static --disable-shared + $(package)_config_opts := --without-zlib --without-png --without-harfbuzz --without-bzip2 --enable-static --disable-shared $(package)_config_opts += --enable-option-checking --without-brotli $(package)_config_opts += --with-pic endef +define $(package)_preprocess_cmds + rm -rf docs +endef + define $(package)_config_cmds - printenv && \ - echo "$($(package)_autoconf)" && \ $($(package)_autoconf) endef From 249e31f5fabc4065998715571e7f0d4e1b78df57 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 25 Sep 2024 00:47:08 +0200 Subject: [PATCH 11/76] depends: utf8proc: update to 2.9.0 --- contrib/depends/packages/utf8proc.mk | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/contrib/depends/packages/utf8proc.mk b/contrib/depends/packages/utf8proc.mk index 1205538..2d8dfb2 100644 --- a/contrib/depends/packages/utf8proc.mk +++ b/contrib/depends/packages/utf8proc.mk @@ -1,28 +1,23 @@ package=utf8proc -$(package)_version=2.8.0 -$(package)_download_path=https://github.com/JuliaStrings/utf8proc/archive/refs/tags/ -$(package)_download_file=v$($(package)_version).tar.gz +$(package)_version=2.9.0 +$(package)_download_path=https://github.com/JuliaStrings/utf8proc/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=a0a60a79fe6f6d54e7d411facbfcc867a6e198608f2cd992490e46f04b1bcecc +$(package)_sha256_hash=bd215d04313b5bc42c1abedbcb0a6574667e31acee1085543a232204e36384c4 $(package)_patches=force_static.patch +$(package)_build_subdir=build define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/force_static.patch endef define $(package)_config_cmds - echo "$($(package)_cmake)" && \ - mkdir build && \ - cd build && \ - $($(package)_cmake) .. + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds - cd build && \ - $(MAKE) + $(MAKE) endef define $(package)_stage_cmds - cd build && \ - $(MAKE) DESTDIR=$($(package)_staging_dir) install + $(MAKE) DESTDIR=$($(package)_staging_dir) install endef From e4e246fc8a5b5dcdac99d4dd64d86dc014cee18f Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 25 Sep 2024 13:36:39 +0200 Subject: [PATCH 12/76] update MAINTENANCE.md --- MAINTENANCE.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 8f72a28..9243eba 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -13,20 +13,24 @@ This document is written for developers and users interested in learning how Fea - Review the diff of any altered package to mitigate the risk of supply chain attacks - Update compilers and security flags for better binary security - Reduce the number of third-party dependencies -- Keep the website VPS up-to-date and secure -- Further harden the [release process](RELEASE.md) +- Keep the [website](https://github.com/feather-wallet/feather-site/blob/master/mirrors.txt) VPS up-to-date and secure +- Contact relevant authorities to take [phishing sites](https://gist.github.com/tobtoht/4039fa3cf922d4fe8bca2f8e3ddac63b) offline +- Make improvements to the [release process](RELEASE.md) Goals: - Set up a bug bounty program for issues that affect privacy or security - Set up a status page with information about project health - Set up a feed for security bulletins +- Sandbox components that handle untrusted input (e.g. QR code scanner) +- Create a package manager for secure distribution of portable binaries +- `-static-pie` release binaries for Linux targets Security issues that affect Feather always warrant a new release as soon as possible. ### 2. Reproducibility -- Improve and maintain tools to check for reproducibility defects +- Improve and maintain tools to check for non-determinism - Ensure releases are reproducible and stay that way - Upload source archives to the fallback mirror @@ -38,7 +42,7 @@ Our Guix time-machine is currently pinned at a commit which implements the ### 3. Bugs -- Fix reproducible bugs and crashes +- Fix bugs and crashes To report a bug, please see: https://docs.featherwallet.org/guides/report-an-issue @@ -57,6 +61,7 @@ Feather does not currently have a test suite (apart from the tests in the Monero Goals: - Reconsider and document default settings +- Write a document on threat modeling Documentation is available at https://docs.featherwallet.org @@ -68,15 +73,11 @@ Documentation is available at https://docs.featherwallet.org Feather should first and foremost be a good __wallet__. Improving features that are closer to this end should have priority. -### 7. Packaging +### 7. Platform Support - Add support for more architectures and operating systems - Drop support for End-of-Life distributions - -Goals: - -- Debian and Guix packages -- Create a document with guidelines for packagers +- Add support for new hardware wallets See: https://docs.featherwallet.org/guides/supported-operating-systems From 325d57cc292124f8b9c78f3f005c0914394f48cd Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 25 Sep 2024 19:33:59 +0200 Subject: [PATCH 13/76] add initial bug bounty program --- SECURITY.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index 9e9035a..e08eb4b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,3 +13,31 @@ The following keys may be used to communicate sensitive information to developer | tobtoht | E87B D921 CDD8 85C9 D78A 38C5 E45B 10DD 027D 2472 | Public keys can be found in [`utils/pubkeys`](utils/pubkeys). + +## Bug Bounty Program + +A bounty may be rewarded to a vulnerability report **if and only if** the issue can result in **a loss of funds**. + +You must describe a **plausible scenario** in which a loss of funds can occur (or has occurred) that **isn't solely attributable to user error**. + +Only **the code** of the **latest tagged release** of **[this repository](https://github.com/feather-wallet/feather/)** is in scope. + +**The bounty can only be awarded in XMR**. The bounty amount for your report is determined by the maintainers and ranges from USD 150 to USD 3000 (in terms of XMR) and depends on the severity of the issue and other factors. + +Further clarifying scope: + +- The issue **must be present in a [signed](https://docs.featherwallet.org/guides/release-signing-key) [release build](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md)**. Custom builds, including distribution packages, are out of scope. +- The developers **must be able to reproduce and fix the issue**. If the issue cannot be fixed **in our code** for any reason, it is out of scope. +- The live [websites](https://github.com/feather-wallet/feather-site/blob/master/mirrors.txt) and their repositories are out of scope. +- Loss of funds due to malware on the user's machine is out of scope. +- Memory imaging, including cold boot attacks, is out of scope. +- Social engineering against users is out of scope. This includes messages received from the [websocket server](https://docs.featherwallet.org/guides/websocket). +- Any form of coercion, physical or psychological, is out of scope. +- Vulnerabilities that are attributable to hardware are out of scope. +- If the issue was fixed in the `master` branch before we receive your report, it is invalid and not eligible for a bounty from this program. +- Vulnerabilities that are present in the monero submodule but were not introduced in patches made by the Feather developers must + be reported [upstream](https://github.com/monero-project/meta/blob/master/VULNERABILITY_RESPONSE_PROCESS.md) and are not eligible for a bounty from this program. +- Vulnerabilities that are present in any of our third-party dependencies must be reported upstream and are not eligible for a bounty from this program. +- Vulnerabilities that are present in [supported hardware wallets](https://docs.featherwallet.org/guides/hardware-wallet-support) must be reported upstream and are not eligible for a bounty from this program. +- A bounty will not be awarded if the reported vulnerability was already known. We may make an exception if you demonstrate that the severity of the issue was underestimated and no immediate fix was planned. +- If, during your research, you disrupt Feather's release infrastructure or services, or attempt to coerce its developers, you will not be awarded a bounty. From 0ee51777cf15cdebde69b79309bde6262ce62508 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 25 Sep 2024 22:52:02 +0200 Subject: [PATCH 14/76] minor edits --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index e08eb4b..15a0081 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -22,9 +22,9 @@ You must describe a **plausible scenario** in which a loss of funds can occur (o Only **the code** of the **latest tagged release** of **[this repository](https://github.com/feather-wallet/feather/)** is in scope. -**The bounty can only be awarded in XMR**. The bounty amount for your report is determined by the maintainers and ranges from USD 150 to USD 3000 (in terms of XMR) and depends on the severity of the issue and other factors. +**The bounty can only be rewarded in XMR**. The bounty amount for your report is determined by the maintainers and ranges from USD 150 to USD 3000 (in terms of XMR) and depends on the severity of the issue and other factors. -Further clarifying scope: +Clarifications on scope: - The issue **must be present in a [signed](https://docs.featherwallet.org/guides/release-signing-key) [release build](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md)**. Custom builds, including distribution packages, are out of scope. - The developers **must be able to reproduce and fix the issue**. If the issue cannot be fixed **in our code** for any reason, it is out of scope. From f9473dd74f076c2dc02435513a9d774e1afa565d Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 27 Sep 2024 12:35:40 +0200 Subject: [PATCH 15/76] depends: qt: update to 6.7.3 --- contrib/depends/packages/native_qt.mk | 12 +- contrib/depends/packages/qt.mk | 16 +- .../depends/patches/qt/CVE-2024-39936.patch | 235 ------------------ 3 files changed, 13 insertions(+), 250 deletions(-) delete mode 100644 contrib/depends/patches/qt/CVE-2024-39936.patch diff --git a/contrib/depends/packages/native_qt.mk b/contrib/depends/packages/native_qt.mk index 4a89a5b..f63868f 100644 --- a/contrib/depends/packages/native_qt.mk +++ b/contrib/depends/packages/native_qt.mk @@ -1,9 +1,9 @@ package=native_qt -$(package)_version=6.7.2 +$(package)_version=6.7.3 $(package)_download_path=https://download.qt.io/official_releases/qt/6.7/$($(package)_version)/submodules $(package)_suffix=everywhere-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=c5f22a5e10fb162895ded7de0963328e7307611c688487b5d152c9ee64767599 +$(package)_sha256_hash=8ccbb9ab055205ac76632c9eeddd1ed6fc66936fc56afc2ed0fd5d9e23da3097 $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches = dont_hardcode_pwd.patch $(package)_patches += fast_fixed_dtoa_no_optimize.patch @@ -13,16 +13,16 @@ $(package)_patches += rcc_hardcode_timestamp.patch $(package)_patches += root_CMakeLists.txt $(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=58e855ad1b2533094726c8a425766b63a04a0eede2ed85086860e54593aa4b2a +$(package)_qttools_sha256_hash=f03bb7df619cd9ac9dba110e30b7bcab5dd88eb8bdc9cc752563b4367233203f $(package)_qtsvg_file_name=qtsvg-$($(package)_suffix) -$(package)_qtsvg_sha256_hash=fb0d1286a35be3583fee34aeb5843c94719e07193bdf1d4d8b0dc14009caef01 +$(package)_qtsvg_sha256_hash=40142cb71fb1e07ad612bc361b67f5d54cd9367f9979ae6b86124a064deda06b $(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix) -$(package)_qtmultimedia_sha256_hash=8ef835115acb9a1d3d2c9f23cfacb43f2c537e3786a8ab822299a2a7765651d3 +$(package)_qtmultimedia_sha256_hash=304d28b8e592435293893b0110d5f3534407604d1e04d8a0b0e5b34afe577303 $(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix) -$(package)_qtshadertools_sha256_hash=edfa34c0ac8c00fcaa949df1d8e7a77d89dadd6386e683ce6c3e3b117e2f7cc1 +$(package)_qtshadertools_sha256_hash=74e512798c7ddbda354a2d8d975211454bbabb47afb7e598892067a5828c0995 $(package)_extra_sources += $($(package)_qttools_file_name) $(package)_extra_sources += $($(package)_qtsvg_file_name) diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index aaa1fd1..04470c2 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -1,9 +1,9 @@ package=qt -$(package)_version=6.7.2 +$(package)_version=6.7.3 $(package)_download_path=https://download.qt.io/official_releases/qt/6.7/$($(package)_version)/submodules $(package)_suffix=everywhere-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=c5f22a5e10fb162895ded7de0963328e7307611c688487b5d152c9ee64767599 +$(package)_sha256_hash=8ccbb9ab055205ac76632c9eeddd1ed6fc66936fc56afc2ed0fd5d9e23da3097 $(package)_darwin_dependencies=native_cctools native_qt openssl $(package)_mingw32_dependencies=openssl native_qt $(package)_linux_dependencies=openssl native_qt freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm libxcb_util_cursor dbus @@ -22,23 +22,22 @@ $(package)_patches += revert-macOS-Silence-warning-about-supporting-secure.patch $(package)_patches += no-resonance-audio.patch $(package)_patches += fix_static_qt_darwin_camera_permissions.patch $(package)_patches += revert-f67ee7c39.patch -$(package)_patches += CVE-2024-39936.patch #$(package)_patches += fix-static-fontconfig-static-linking.patch $(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=58e855ad1b2533094726c8a425766b63a04a0eede2ed85086860e54593aa4b2a +$(package)_qttools_sha256_hash=f03bb7df619cd9ac9dba110e30b7bcab5dd88eb8bdc9cc752563b4367233203f $(package)_qtsvg_file_name=qtsvg-$($(package)_suffix) -$(package)_qtsvg_sha256_hash=fb0d1286a35be3583fee34aeb5843c94719e07193bdf1d4d8b0dc14009caef01 +$(package)_qtsvg_sha256_hash=40142cb71fb1e07ad612bc361b67f5d54cd9367f9979ae6b86124a064deda06b $(package)_qtwebsockets_file_name=qtwebsockets-$($(package)_suffix) -$(package)_qtwebsockets_sha256_hash=5bde4af6ec9ce8c8632b782ab77b82d910721be2c714e6d38902521bcd1d215f +$(package)_qtwebsockets_sha256_hash=ba03007db7ee68a5bc3e3bd1d71e11f3e1f84e470bcb8c54cd7c01bbe1c5990e $(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix) -$(package)_qtmultimedia_sha256_hash=8ef835115acb9a1d3d2c9f23cfacb43f2c537e3786a8ab822299a2a7765651d3 +$(package)_qtmultimedia_sha256_hash=304d28b8e592435293893b0110d5f3534407604d1e04d8a0b0e5b34afe577303 $(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix) -$(package)_qtshadertools_sha256_hash=edfa34c0ac8c00fcaa949df1d8e7a77d89dadd6386e683ce6c3e3b117e2f7cc1 +$(package)_qtshadertools_sha256_hash=74e512798c7ddbda354a2d8d975211454bbabb47afb7e598892067a5828c0995 $(package)_extra_sources += $($(package)_qttools_file_name) $(package)_extra_sources += $($(package)_qtsvg_file_name) @@ -200,7 +199,6 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/libxau-fix.patch && \ patch -p1 -i $($(package)_patch_dir)/revert-macOS-Silence-warning-about-supporting-secure.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_static_qt_darwin_camera_permissions.patch && \ - patch -p1 -i $($(package)_patch_dir)/CVE-2024-39936.patch && \ cd ../qtmultimedia && \ patch -p1 -i $($(package)_patch_dir)/qtmultimedia-fixes.patch && \ patch -p1 -i $($(package)_patch_dir)/v4l2.patch && \ diff --git a/contrib/depends/patches/qt/CVE-2024-39936.patch b/contrib/depends/patches/qt/CVE-2024-39936.patch deleted file mode 100644 index 440e0cc..0000000 --- a/contrib/depends/patches/qt/CVE-2024-39936.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 2b1e36e183ce75c224305c7a94457b92f7a5cf58 Mon Sep 17 00:00:00 2001 -From: Mårten Nordheim -Date: Tue, 25 Jun 2024 17:09:35 +0200 -Subject: [PATCH] HTTP2: Delay any communication until encrypted() can be responded to - -We have the encrypted() signal that lets users do extra checks on the -established connection. It is emitted as BlockingQueued, so the HTTP -thread stalls until it is done emitting. Users can potentially call -abort() on the QNetworkReply at that point, which is passed as a Queued -call back to the HTTP thread. That means that any currently queued -signal emission will be processed before the abort() call is processed. - -In the case of HTTP2 it is a little special since it is multiplexed and -the code is built to start requests as they are available. This means -that, while the code worked fine for HTTP1, since one connection only -has one request, it is not working for HTTP2, since we try to send more -requests in-between the encrypted() signal and the abort() call. - -This patch changes the code to delay any communication until the -encrypted() signal has been emitted and processed, for HTTP2 only. -It's done by adding a few booleans, both to know that we have to return -early and so we can keep track of what events arose and what we need to -resume once enough time has passed that any abort() call must have been -processed. - -Fixes: QTBUG-126610 -Pick-to: 6.5 6.2 5.15 5.12 -Change-Id: Ic25a600c278203256e35f541026f34a8783235ae -Reviewed-by: Marc Mutz -Reviewed-by: Volker Hilsheimer -(cherry picked from commit b1e75376cc3adfc7da5502a277dfe9711f3e0536) -Reviewed-by: Qt Cherry-pick Bot -(cherry picked from commit 0fb43e4395da34d561814242a0186999e4956e28) ---- - -diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp -index 0abd99b..3631b13 100644 ---- a/src/network/access/qhttp2protocolhandler.cpp -+++ b/src/network/access/qhttp2protocolhandler.cpp -@@ -303,12 +303,12 @@ - } - } - -- if (!prefaceSent && !sendClientPreface()) -- return false; -- - if (!requests.size()) - return true; - -+ if (!prefaceSent && !sendClientPreface()) -+ return false; -+ - m_channel->state = QHttpNetworkConnectionChannel::WritingState; - // Check what was promised/pushed, maybe we do not have to send a request - // and have a response already? -diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp -index 6766989..1e4161d 100644 ---- a/src/network/access/qhttpnetworkconnectionchannel.cpp -+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp -@@ -209,6 +209,10 @@ - bool QHttpNetworkConnectionChannel::sendRequest() - { - Q_ASSERT(protocolHandler); -+ if (waitingForPotentialAbort) { -+ needInvokeSendRequest = true; -+ return false; // this return value is unused -+ } - return protocolHandler->sendRequest(); - } - -@@ -221,21 +225,28 @@ - void QHttpNetworkConnectionChannel::sendRequestDelayed() - { - QMetaObject::invokeMethod(this, [this] { -- Q_ASSERT(protocolHandler); - if (reply) -- protocolHandler->sendRequest(); -+ sendRequest(); - }, Qt::ConnectionType::QueuedConnection); - } - - void QHttpNetworkConnectionChannel::_q_receiveReply() - { - Q_ASSERT(protocolHandler); -+ if (waitingForPotentialAbort) { -+ needInvokeReceiveReply = true; -+ return; -+ } - protocolHandler->_q_receiveReply(); - } - - void QHttpNetworkConnectionChannel::_q_readyRead() - { - Q_ASSERT(protocolHandler); -+ if (waitingForPotentialAbort) { -+ needInvokeReadyRead = true; -+ return; -+ } - protocolHandler->_q_readyRead(); - } - -@@ -1239,7 +1250,18 @@ - if (!h2RequestsToSend.isEmpty()) { - // Similar to HTTP/1.1 counterpart below: - const auto &pair = std::as_const(h2RequestsToSend).first(); -+ waitingForPotentialAbort = true; - emit pair.second->encrypted(); -+ -+ // We don't send or handle any received data until any effects from -+ // emitting encrypted() have been processed. This is necessary -+ // because the user may have called abort(). We may also abort the -+ // whole connection if the request has been aborted and there is -+ // no more requests to send. -+ QMetaObject::invokeMethod(this, -+ &QHttpNetworkConnectionChannel::checkAndResumeCommunication, -+ Qt::QueuedConnection); -+ - // In case our peer has sent us its settings (window size, max concurrent streams etc.) - // let's give _q_receiveReply a chance to read them first ('invokeMethod', QueuedConnection). - } -@@ -1257,6 +1279,28 @@ - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); - } - -+ -+void QHttpNetworkConnectionChannel::checkAndResumeCommunication() -+{ -+ Q_ASSERT(connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 -+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct); -+ -+ // Because HTTP/2 requires that we send a SETTINGS frame as the first thing we do, and respond -+ // to a SETTINGS frame with an ACK, we need to delay any handling until we can ensure that any -+ // effects from emitting encrypted() have been processed. -+ // This function is called after encrypted() was emitted, so check for changes. -+ -+ if (!reply && h2RequestsToSend.isEmpty()) -+ abort(); -+ waitingForPotentialAbort = false; -+ if (needInvokeReadyRead) -+ _q_readyRead(); -+ if (needInvokeReceiveReply) -+ _q_receiveReply(); -+ if (needInvokeSendRequest) -+ sendRequest(); -+} -+ - void QHttpNetworkConnectionChannel::requeueHttp2Requests() - { - const auto h2RequestsToSendCopy = std::exchange(h2RequestsToSend, {}); -diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h -index c42290f..061f20f 100644 ---- a/src/network/access/qhttpnetworkconnectionchannel_p.h -+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h -@@ -74,6 +74,10 @@ - QAbstractSocket *socket; - bool ssl; - bool isInitialized; -+ bool waitingForPotentialAbort = false; -+ bool needInvokeReceiveReply = false; -+ bool needInvokeReadyRead = false; -+ bool needInvokeSendRequest = false; - ChannelState state; - QHttpNetworkRequest request; // current request, only used for HTTP - QHttpNetworkReply *reply; // current reply for this request, only used for HTTP -@@ -146,6 +150,8 @@ - void closeAndResendCurrentRequest(); - void resendCurrentRequest(); - -+ void checkAndResumeCommunication(); -+ - bool isSocketBusy() const; - bool isSocketWriting() const; - bool isSocketWaiting() const; -diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp -index 00efbc9..c02e7b7 100644 ---- a/tests/auto/network/access/http2/tst_http2.cpp -+++ b/tests/auto/network/access/http2/tst_http2.cpp -@@ -106,6 +106,8 @@ - - void duplicateRequestsWithAborts(); - -+ void abortOnEncrypted(); -+ - protected slots: - // Slots to listen to our in-process server: - void serverStarted(quint16 port); -@@ -1479,6 +1481,48 @@ - QCOMPARE(finishedCount, ExpectedSuccessfulRequests); - } - -+void tst_Http2::abortOnEncrypted() -+{ -+#if !QT_CONFIG(ssl) -+ QSKIP("TLS support is needed for this test"); -+#else -+ clearHTTP2State(); -+ serverPort = 0; -+ -+ ServerPtr targetServer(newServer(defaultServerSettings, H2Type::h2Direct)); -+ -+ QMetaObject::invokeMethod(targetServer.data(), "startServer", Qt::QueuedConnection); -+ runEventLoop(); -+ -+ nRequests = 1; -+ nSentRequests = 0; -+ -+ const auto url = requestUrl(H2Type::h2Direct); -+ QNetworkRequest request(url); -+ request.setAttribute(QNetworkRequest::Http2DirectAttribute, true); -+ -+ std::unique_ptr reply{manager->get(request)}; -+ reply->ignoreSslErrors(); -+ connect(reply.get(), &QNetworkReply::encrypted, reply.get(), [reply = reply.get()](){ -+ reply->abort(); -+ }); -+ connect(reply.get(), &QNetworkReply::errorOccurred, this, &tst_Http2::replyFinishedWithError); -+ -+ runEventLoop(); -+ STOP_ON_FAILURE -+ -+ QCOMPARE(nRequests, 0); -+ QCOMPARE(reply->error(), QNetworkReply::OperationCanceledError); -+ -+ const bool res = QTest::qWaitFor( -+ [this, server = targetServer.get()]() { -+ return serverGotSettingsACK || prefaceOK || nSentRequests > 0; -+ }, -+ 500); -+ QVERIFY(!res); -+#endif // QT_CONFIG(ssl) -+} -+ - void tst_Http2::serverStarted(quint16 port) - { - serverPort = port; From d600fdbedb920b185388810da43821cf7c61790c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 28 Sep 2024 19:16:15 +0200 Subject: [PATCH 16/76] depends: libgpg-error: update to 1.50 --- contrib/depends/packages/libgpg-error.mk | 17 ++++++++++------ .../libgpg-error/declare_environ_macos.patch | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 contrib/depends/patches/libgpg-error/declare_environ_macos.patch diff --git a/contrib/depends/packages/libgpg-error.mk b/contrib/depends/packages/libgpg-error.mk index c668f80..d5cf9b2 100644 --- a/contrib/depends/packages/libgpg-error.mk +++ b/contrib/depends/packages/libgpg-error.mk @@ -1,25 +1,30 @@ package=libgpg-error -$(package)_version=1.49 +$(package)_version=1.50 $(package)_download_path=https://www.gnupg.org/ftp/gcrypt/libgpg-error/ $(package)_file_name=libgpg-error-$($(package)_version).tar.gz -$(package)_sha256_hash=e59cc3ced0ae86f49073e2f2344676919a82fc5033716bee7232f6f778158792 +$(package)_sha256_hash=34a3b36ec8ad830f8f3ceb5db583d1f6dc8ae4c31d04f6da18ea18dd95396ab0 +$(package)_patches=declare_environ_macos.patch define $(package)_set_vars - $(package)_build_opts=CFLAGS="-fPIE" + $(package)_config_opts := --enable-static --disable-shared + $(package)_config_opts += --disable-doc --disable-tests + $(package)_config_opts += --enable-install-gpg-error-config + $(package)_build_opts := CFLAGS="-fPIE" endef define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/declare_environ_macos.patch && \ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux endef define $(package)_config_cmds - $($(package)_autoconf) --enable-static --disable-shared --enable-install-gpg-error-config + $($(package)_autoconf) endef define $(package)_build_cmds - $(MAKE) $($(package)_build_opts) + $(MAKE) $($(package)_build_opts) endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install + $(MAKE) DESTDIR=$($(package)_staging_dir) install endef diff --git a/contrib/depends/patches/libgpg-error/declare_environ_macos.patch b/contrib/depends/patches/libgpg-error/declare_environ_macos.patch new file mode 100644 index 0000000..a2afe25 --- /dev/null +++ b/contrib/depends/patches/libgpg-error/declare_environ_macos.patch @@ -0,0 +1,20 @@ +Subject: [PATCH] core: Declare environ for macOS and others. +--- +Index: src/spawn-posix.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/spawn-posix.c b/src/spawn-posix.c +--- a/src/spawn-posix.c (revision d18e28a948307fab016b1eed467a70653ca9576e) ++++ b/src/spawn-posix.c (revision a59e902b887fd92337c9728f668cf9c89da3957a) +@@ -57,6 +57,9 @@ + + #include "gpgrt-int.h" + ++/* (Only glibc's unistd.h declares this iff _GNU_SOURCE is used.) */ ++extern char **environ; ++ + + /* Definition for the gpgrt_spawn_actions_t. Note that there is a + * different one for Windows. */ From 0634845cb9456faeac23a04c2e98665af0ccac94 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 28 Sep 2024 19:20:34 +0200 Subject: [PATCH 17/76] depends: libgcrypt: update to 1.11.0 --- contrib/depends/packages/libgcrypt.mk | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/contrib/depends/packages/libgcrypt.mk b/contrib/depends/packages/libgcrypt.mk index d17870a..1912cd1 100644 --- a/contrib/depends/packages/libgcrypt.mk +++ b/contrib/depends/packages/libgcrypt.mk @@ -1,8 +1,8 @@ package=libgcrypt -$(package)_version=1.10.3 +$(package)_version=1.11.0 $(package)_download_path=https://www.gnupg.org/ftp/gcrypt/libgcrypt/ -$(package)_file_name=libgcrypt-$($(package)_version).tar.bz2 -$(package)_sha256_hash=8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa +$(package)_file_name=libgcrypt-$($(package)_version).tar.gz +$(package)_sha256_hash=2382891207d3b000b20c81dbf2036516a535d31abd80f57d455e711e1dde5ff5 $(package)_dependencies=libgpg-error define $(package)_set_vars @@ -13,16 +13,9 @@ define $(package)_preprocess_cmds cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux endef -# TODO: building on linux with $($(package)_autoconf) fails for mysterious reasons -ifeq ($(host_os),linux) -define $(package)_config_cmds - CFLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --host=$(host) --enable-digests="sha256 blake2" --enable-ciphers="aes chacha20" --disable-amd64-as-feature-detection --disable-asm --disable-avx-support --disable-avx2-support --disable-sse41-support --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix) -endef -else define $(package)_config_cmds $($(package)_autoconf) --disable-shared --enable-static --disable-doc --disable-asm --with-libgpg-error-prefix=$(host_prefix) endef -endif define $(package)_build_cmds $(MAKE) $($(package)_build_opts) From 6cf0362ae33ef379638561a4a2931b24c6dcadb3 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 09:36:18 +0200 Subject: [PATCH 18/76] depends: protobuf: update to 28.2 --- CMakeLists.txt | 2 ++ contrib/depends/packages/abseil.mk | 27 +++++++++++++++++ contrib/depends/packages/native_abseil.mk | 18 ++++++++++++ contrib/depends/packages/native_protobuf.mk | 29 ++++++++++++------- contrib/depends/packages/packages.mk | 4 +-- contrib/depends/packages/protobuf.mk | 26 +++++++++-------- contrib/depends/packages/qt.mk | 1 - contrib/depends/patches/abseil/no_librt.patch | 12 ++++++++ contrib/depends/toolchain.cmake.in | 8 ++--- contrib/guix/libexec/build.sh | 2 ++ contrib/guix/manifest.scm | 4 +-- monero | 2 +- src/CMakeLists.txt | 3 ++ 13 files changed, 104 insertions(+), 34 deletions(-) create mode 100644 contrib/depends/packages/abseil.mk create mode 100644 contrib/depends/packages/native_abseil.mk create mode 100644 contrib/depends/patches/abseil/no_librt.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index c7832f4..429afb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ set(PACKAGE_URL "https://featherwallet.org/") set(COPYRIGHT_YEAR "2024") set(COPYRIGHT_HOLDERS "The Monero Project") +cmake_policy(SET CMP0074 NEW) + # Configurable options option(STATIC "Link libraries statically, requires static Qt" OFF) option(SELF_CONTAINED "Disable when building Feather for packages" OFF) diff --git a/contrib/depends/packages/abseil.mk b/contrib/depends/packages/abseil.mk new file mode 100644 index 0000000..f0f2f3f --- /dev/null +++ b/contrib/depends/packages/abseil.mk @@ -0,0 +1,27 @@ +package=abseil +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_download_file=$(native_$(package)_download_file) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_patches=no_librt.patch + +define $(package)_set_vars + $(package)_cxxflags+=-std=c++17 +endef + +define $(package)_preprocess_cmds + patch -p1 -i $($(package)_patch_dir)/no_librt.patch +endef + +define $(package)_config_cmds + $($(package)_cmake) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/native_abseil.mk b/contrib/depends/packages/native_abseil.mk new file mode 100644 index 0000000..d914fe1 --- /dev/null +++ b/contrib/depends/packages/native_abseil.mk @@ -0,0 +1,18 @@ +package=native_abseil +$(package)_version=20240722.0 +$(package)_download_path=https://github.com/abseil/abseil-cpp/archive/refs/tags/ +$(package)_download_file=$($(package)_version).tar.gz +$(package)_file_name=abseil-$($(package)_version).tar.gz +$(package)_sha256_hash=f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3 + +define $(package)_config_cmds + $($(package)_cmake) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/native_protobuf.mk b/contrib/depends/packages/native_protobuf.mk index 986f27f..aadc1b1 100644 --- a/contrib/depends/packages/native_protobuf.mk +++ b/contrib/depends/packages/native_protobuf.mk @@ -1,27 +1,34 @@ package=native_protobuf -$(package)_version=3.21.12 -$(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v21.12/ -$(package)_file_name=protobuf-cpp-$($(package)_version).tar.gz -$(package)_sha256_hash=4eab9b524aa5913c6fffb20b2a8abf5ef7f95a80bc0701f3a6dbb4c607f73460 -$(package)_cxxflags=-std=c++11 +$(package)_version=28.2 +$(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v$($(package)_version) +$(package)_file_name=protobuf-$($(package)_version).tar.gz +$(package)_sha256_hash=b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db +$(package)_dependencies=native_abseil define $(package)_set_vars - $(package)_config_opts=--disable-shared --prefix=$(build_prefix) - $(package)_config_opts_linux=--with-pic + $(package)_cxxflags+=-std=c++17 + $(package)_config_opts=-Dprotobuf_BUILD_TESTS=OFF + $(package)_config_opts+=-Dprotobuf_ABSL_PROVIDER=package + $(package)_config_opts+=-Dprotobuf_BUILD_SHARED_LIBS=OFF + $(package)_config_opts+=-Dprotobuf_WITH_ZLIB=OFF +endef + +define $(package)_preprocess_cmds + rm -rf docs php/src/GPBMetadata compatibility objectivec/Tests csharp/keys php/tests src/google/protobuf/testdata csharp/src/Google.Protobuf.Test endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) endef define $(package)_build_cmds - $(MAKE) -C src protoc + $(MAKE) endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-binPROGRAMS install-nobase_dist_protoDATA + $(MAKE) DESTDIR=$($(package)_staging_dir) install endef define $(package)_postprocess_cmds - rm -rf lib/ + rm -rf lib64 endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index b8e4330..ee52ff3 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -1,5 +1,5 @@ -packages := boost openssl libiconv unbound qrencode libsodium polyseed hidapi protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp -native_packages := native_qt native_protobuf +packages := boost openssl libiconv unbound qrencode libsodium polyseed hidapi abseil protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp +native_packages := native_qt native_abseil native_protobuf linux_packages := eudev libfuse libsquashfuse zstd appimage_runtime linux_native_packages = diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk index b91db0e..2cfa7e0 100644 --- a/contrib/depends/packages/protobuf.mk +++ b/contrib/depends/packages/protobuf.mk @@ -3,27 +3,29 @@ $(package)_version=$(native_$(package)_version) $(package)_download_path=$(native_$(package)_download_path) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) -$(package)_dependencies=native_$(package) -$(package)_cxxflags=-std=c++11 +$(package)_dependencies=abseil define $(package)_set_vars - $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc - $(package)_config_opts_linux=--with-pic + $(package)_cxxflags+=-std=c++17 + $(package)_config_opts=-Dprotobuf_ABSL_PROVIDER=package + $(package)_config_opts+=-Dprotobuf_BUILD_TESTS=OFF + $(package)_config_opts+=-Dprotobuf_BUILD_SHARED_LIBS=OFF + $(package)_config_opts+=-Dprotobuf_BUILD_PROTOC_BINARIES=OFF + $(package)_config_opts+=-Dprotobuf_WITH_ZLIB=OFF +endef + +define $(package)_preprocess_cmds + rm -rf docs php/src/GPBMetadata compatibility objectivec/Tests csharp/keys php/tests src/google/protobuf/testdata csharp/src/Google.Protobuf.Test endef define $(package)_config_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub ./third_party/googletest/googletest/build-aux/ && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub ./third_party/googletest/googlemock/build-aux/ && \ - $($(package)_autoconf) + $($(package)_cmake) endef define $(package)_build_cmds - $(MAKE) -C src libprotobuf.la + $(MAKE) endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-nobase_includeHEADERS &&\ - $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA &&\ - cp -f src/.libs/libprotobuf.a $($(package)_staging_prefix_dir)/lib/ + $(MAKE) DESTDIR=$($(package)_staging_dir) install endef diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index 04470c2..47fb50c 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -54,7 +54,6 @@ $(package)_config_opts += -DINSTALL_LIBEXECDIR=$(build_prefix)/bin $(package)_config_opts += -DQT_BUILD_EXAMPLES=FALSE $(package)_config_opts += -DQT_BUILD_TESTS=FALSE $(package)_config_opts += -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake - $(package)_config_opts += -DINPUT_cups=no $(package)_config_opts += -DINPUT_egl=no $(package)_config_opts += -DINPUT_eglfs=no diff --git a/contrib/depends/patches/abseil/no_librt.patch b/contrib/depends/patches/abseil/no_librt.patch new file mode 100644 index 0000000..8fdd165 --- /dev/null +++ b/contrib/depends/patches/abseil/no_librt.patch @@ -0,0 +1,12 @@ +diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt +index 97994fc6..06ab426c 100644 +--- a/absl/base/CMakeLists.txt ++++ b/absl/base/CMakeLists.txt +@@ -240,7 +240,6 @@ absl_cc_library( + ${ABSL_DEFAULT_COPTS} + LINKOPTS + ${ABSL_DEFAULT_LINKOPTS} +- $<$:-lrt> + $<$:-ladvapi32> + DEPS + absl::atomic_hook diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index 267b056..da73d47 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -37,6 +37,9 @@ SET(Terminfo_LIBRARY @prefix@/lib/libtinfo.a) SET(UNBOUND_INCLUDE_DIR @prefix@/include) SET(UNBOUND_LIBRARIES @prefix@/lib/libunbound.a) +SET(CMAKE_FIND_USE_PACKAGE_ROOT_PATH ON) +SET(absl_ROOT @prefix@) + SET(NATIVE_BIN_PATH @prefix@/native/bin CACHE FILEPATH "path to native binaries" FORCE) SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE) @@ -49,11 +52,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") SET(LIBUSB-1.0_LIBRARY @prefix@/lib/libusb-1.0.a) SET(LIBUDEV_LIBRARY @prefix@/lib/libudev.a) -SET(Protobuf_FOUND 1) -SET(Protobuf_PROTOC_EXECUTABLE @prefix@/native/bin/protoc CACHE FILEPATH "Path to the native protoc") -SET(Protobuf_INCLUDE_DIR @prefix@/include CACHE PATH "Protobuf include dir") -SET(Protobuf_INCLUDE_DIRS @prefix@/include CACHE PATH "Protobuf include dir") -SET(Protobuf_LIBRARY @prefix@/lib/libprotobuf.a CACHE FILEPATH "Protobuf library") endif() endif() diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index b0473ec..c434208 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -292,6 +292,8 @@ case "$HOST" in arm-linux-gnueabihf) HOST_CXXFLAGS="${HOST_CXXFLAGS} -Wno-psabi" ;; esac +export USE_DEVICE_TREZOR_MANDATORY=1 + # Make $HOST-specific native binaries from depends available in $PATH export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" mkdir -p "$DISTSRC" diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index db968ac..46508a0 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -319,8 +319,8 @@ chain for " target " development.")) (make-bitcoin-cross-toolchain target))) ((string-contains target "darwin") (list - gcc-toolchain-10 - (list gcc-toolchain-10 "static") + gcc-toolchain-11 + (list gcc-toolchain-11 "static") binutils clang-toolchain-10 ldid)) diff --git a/monero b/monero index 6a88faa..e572251 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit 6a88faa9af20c56363bac563a5c0b803ea2695dd +Subproject commit e572251b548b913dd00079d1ddeef4dea79a8f58 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9234e06..e137642 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,6 +293,9 @@ if(DEPENDS) endif() if(DEVICE_TREZOR_READY) + if (DEPENDS) + find_package(Protobuf CONFIG REQUIRED) + endif() target_link_libraries(feather PRIVATE ${TREZOR_DEP_LIBS}) endif() From 9a78ede9d6a13e989fb78e7aa781252293612bda Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 10:49:53 +0200 Subject: [PATCH 19/76] cmake: trezor-common no longer exists --- monero | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monero b/monero index e572251..e39e3e6 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit e572251b548b913dd00079d1ddeef4dea79a8f58 +Subproject commit e39e3e68ba432846199634baca9c2d3ad0d926cd From 1719df36de8b4000996b4ebcf0a7d8b34bec11f4 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 12:41:52 +0200 Subject: [PATCH 20/76] depends: protobuf: fix riscv64 build --- contrib/depends/packages/protobuf.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk index 2cfa7e0..41a0d11 100644 --- a/contrib/depends/packages/protobuf.mk +++ b/contrib/depends/packages/protobuf.mk @@ -12,6 +12,7 @@ define $(package)_set_vars $(package)_config_opts+=-Dprotobuf_BUILD_SHARED_LIBS=OFF $(package)_config_opts+=-Dprotobuf_BUILD_PROTOC_BINARIES=OFF $(package)_config_opts+=-Dprotobuf_WITH_ZLIB=OFF + $(package)_config_opts+=-Dprotobuf_BUILD_LIBUPB=OFF endef define $(package)_preprocess_cmds From 1a1109096271d490297556c6b66fb7503e831b35 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 12:46:38 +0200 Subject: [PATCH 21/76] depends: libfuse: don't build examples --- contrib/depends/patches/libfuse/toolchain.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/depends/patches/libfuse/toolchain.txt b/contrib/depends/patches/libfuse/toolchain.txt index e001766..c65a94e 100644 --- a/contrib/depends/patches/libfuse/toolchain.txt +++ b/contrib/depends/patches/libfuse/toolchain.txt @@ -13,6 +13,7 @@ endian = 'little' [project options] utils = false +examples = false [built-in options] default_library = 'static' From 70402bb55e754bec0e75643acc3059a58faa7cce Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 12:53:32 +0200 Subject: [PATCH 22/76] ci: properly format hashes --- .github/workflows/guix.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/guix.yml b/.github/workflows/guix.yml index 68fc141..d6221bb 100644 --- a/.github/workflows/guix.yml +++ b/.github/workflows/guix.yml @@ -82,7 +82,9 @@ jobs: merge-multiple: true - name: print hashes run: | + echo '```' >> $GITHUB_STEP_SUMMARY uname --machine && find **/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY - uses: actions/upload-artifact@v4 with: name: "logs" From a6289021a3f7710c0e3a6beb8aa420068e81607f Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 13:00:22 +0200 Subject: [PATCH 23/76] cmake: fix find protobuf --- src/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e137642..e453508 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,8 +293,9 @@ if(DEPENDS) endif() if(DEVICE_TREZOR_READY) - if (DEPENDS) - find_package(Protobuf CONFIG REQUIRED) + find_package(Protobuf CONFIG) + if (NOT Protobuf_FOUND) + find_package(Protobuf REQUIRED) endif() target_link_libraries(feather PRIVATE ${TREZOR_DEP_LIBS}) endif() From 23d794469fa4fa12baa88dd377951c6da701438d Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 13:38:38 +0200 Subject: [PATCH 24/76] .gitignore: add cmake-build-release --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8971fe0..8f9e4d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store lib/* cmake-build-debug/* +cmake-build-release/* .idea *.user *.stash From 2a1ac4afa0455d243700e162907381c9ae25f3e3 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 13:39:13 +0200 Subject: [PATCH 25/76] guix: remap guix store on mingw --- contrib/guix/manifest.scm | 9 ++++++++- .../patches/winpthreads-remap-guix-store.patch | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 contrib/guix/patches/winpthreads-remap-guix-store.patch diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 46508a0..e3b8415 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -119,10 +119,17 @@ desirable for building Feather Wallet release binaries." (search-our-patches "gcc-remap-guix-store.patch" "vmov-alignment.patch"))) +(define (winpthreads-patches mingw-w64-x86_64-winpthreads) + (package-with-extra-patches mingw-w64-x86_64-winpthreads + (search-our-patches "winpthreads-remap-guix-store.patch"))) + (define (make-mingw-pthreads-cross-toolchain target) "Create a cross-compilation toolchain package for TARGET" (let* ((xbinutils (cross-binutils target)) - (pthreads-xlibc mingw-w64-x86_64-winpthreads) + (machine (substring target 0 (string-index target #\-))) + (pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine + #:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc)) + #:with-winpthreads? #t))) (pthreads-xgcc (cross-gcc target #:xgcc (gcc-mingw-patches mingw-w64-base-gcc) #:xbinutils xbinutils diff --git a/contrib/guix/patches/winpthreads-remap-guix-store.patch b/contrib/guix/patches/winpthreads-remap-guix-store.patch new file mode 100644 index 0000000..2c12585 --- /dev/null +++ b/contrib/guix/patches/winpthreads-remap-guix-store.patch @@ -0,0 +1,17 @@ +Without ffile-prefix-map, the debug symbols will contain paths for the +guix store which will include the hashes of each package. However, the +hash for the same package will differ when on different architectures. +In order to be reproducible regardless of the architecture used to build +the package, map all guix store prefixes to something fixed, e.g. /usr. + +--- a/mingw-w64-libraries/winpthreads/Makefile.in ++++ b/mingw-w64-libraries/winpthreads/Makefile.in +@@ -454,7 +454,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = . tests +-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN ++AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) + ACLOCAL_AMFLAGS = -I m4 + lib_LTLIBRARIES = libwinpthread.la + include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h From cbbc9526a59c0663480571a8ee8ac50bd8e78819 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 14:28:56 +0200 Subject: [PATCH 26/76] wizard: don't enumerate supported devices --- src/wizard/PageHardwareDevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wizard/PageHardwareDevice.cpp b/src/wizard/PageHardwareDevice.cpp index 7fecf86..b1c749c 100644 --- a/src/wizard/PageHardwareDevice.cpp +++ b/src/wizard/PageHardwareDevice.cpp @@ -16,8 +16,8 @@ PageHardwareDevice::PageHardwareDevice(WizardFields *fields, QWidget *parent) { ui->setupUi(this); - ui->combo_deviceType->addItem("Ledger Nano S (PLUS) / X", DeviceType::LEDGER); - ui->combo_deviceType->addItem("Trezor Model T / Safe 3", DeviceType::TREZOR); + ui->combo_deviceType->addItem("Ledger", DeviceType::LEDGER); + ui->combo_deviceType->addItem("Trezor", DeviceType::TREZOR); connect(ui->btnOptions, &QPushButton::clicked, this, &PageHardwareDevice::onOptionsClicked); } From ef8db19c94ee412dec6cda4dfd8f386a3f3e3de0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 14:38:42 +0200 Subject: [PATCH 27/76] send: improve split tx error message --- src/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 44b6808..1bcd07b 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -910,7 +910,7 @@ void MainWindow::onTransactionCreated(PendingTransaction *tx, const QVectortxCount() > 1) { - Utils::showError(this, "Failed to construct transaction", "Split transactions are not supported", {"Try sending a smaller amount."}); + Utils::showError(this, "Failed to construct transaction", "Transaction tries to spend too many inputs", {"Send a smaller amount of XMR to yourself first."}); m_wallet->disposeTransaction(tx); return; } From 17a7ac26d3ff4253162167d0a42a8db3c227a60b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 15:11:20 +0200 Subject: [PATCH 28/76] build: remove libiconv --- CMakeLists.txt | 14 +++++---- contrib/depends/packages/boost.mk | 6 ++-- contrib/depends/packages/libiconv.mk | 29 ------------------- contrib/depends/packages/packages.mk | 2 +- .../patches/libiconv/fix-whitespace.patch | 13 --------- contrib/depends/toolchain.cmake.in | 2 -- monero | 2 +- src/CMakeLists.txt | 4 --- src/polyseed/polyseed.cpp | 7 ----- 9 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 contrib/depends/packages/libiconv.mk delete mode 100644 contrib/depends/patches/libiconv/fix-whitespace.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 429afb2..86538c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,16 +138,18 @@ if(MINGW) endif() set(BOOST_COMPONENTS - system - filesystem - thread - date_time chrono + date_time + filesystem + program_options regex serialization - program_options - locale + system + thread ) +if (WIN32) + list(APPEND BOOST_COMPONENTS locale) +endif() if(STACK_TRACE AND UNIX AND NOT APPLE) list(APPEND BOOST_COMPONENTS diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk index 83d3b43..5e08c30 100644 --- a/contrib/depends/packages/boost.mk +++ b/contrib/depends/packages/boost.mk @@ -3,7 +3,6 @@ $(package)_version=1.85.0 $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version)/source/ $(package)_file_name=$(package)_$(subst .,_,$($(package)_version)).tar.gz $(package)_sha256_hash=be0d91732d5b0cc6fbb275c7939974457e79b54d6f07ce2e3dfdd68bef883b0b -$(package)_dependencies=libiconv $(package)_patches=disable_addr2line.patch define $(package)_set_vars @@ -21,7 +20,8 @@ $(package)_toolset_$(host_os)=gcc $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_toolset_darwin=darwin $(package)_archiver_darwin=$($(package)_libtool) -$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale,stacktrace +$(package)_config_libraries_$(host_os)="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,stacktrace" +$(package)_config_libraries_mingw32="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,stacktrace,locale" $(package)_cxxflags=-std=c++17 $(package)_cxxflags_linux=-fPIC $(package)_cxxflags_freebsd=-fPIC @@ -33,7 +33,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) + ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries_$(host_os)) endef define $(package)_build_cmds diff --git a/contrib/depends/packages/libiconv.mk b/contrib/depends/packages/libiconv.mk deleted file mode 100644 index de6c577..0000000 --- a/contrib/depends/packages/libiconv.mk +++ /dev/null @@ -1,29 +0,0 @@ -package=libiconv -$(package)_version=1.17 -$(package)_download_path=https://ftp.gnu.org/gnu/libiconv -$(package)_file_name=libiconv-$($(package)_version).tar.gz -$(package)_sha256_hash=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313 - -define $(package)_set_vars - $(package)_config_opts=--disable-nls - $(package)_config_opts=--enable-static - $(package)_config_opts=--disable-shared - $(package)_config_opts_linux=--with-pic - $(package)_config_opts_freebsd=--with-pic -endef - -define $(package)_config_cmds - $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm lib/*.la -endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index ee52ff3..174a3b9 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -1,4 +1,4 @@ -packages := boost openssl libiconv unbound qrencode libsodium polyseed hidapi abseil protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp +packages := boost openssl unbound qrencode libsodium polyseed hidapi abseil protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp native_packages := native_qt native_abseil native_protobuf linux_packages := eudev libfuse libsquashfuse zstd appimage_runtime diff --git a/contrib/depends/patches/libiconv/fix-whitespace.patch b/contrib/depends/patches/libiconv/fix-whitespace.patch deleted file mode 100644 index 531364b..0000000 --- a/contrib/depends/patches/libiconv/fix-whitespace.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/preload/configure b/preload/configure -index aab5c77..e20b8f0 100755 ---- a/preload/configure -+++ b/preload/configure -@@ -588,7 +588,7 @@ MAKEFLAGS= - PACKAGE_NAME='libiconv' - PACKAGE_TARNAME='libiconv' - PACKAGE_VERSION='0' --PACKAGE_STRING='libiconv 0' -+PACKAGE_STRING='libiconv0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index da73d47..b7e6f7e 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -56,8 +56,6 @@ endif() endif() -set(ICONV_LIBRARIES @prefix@/lib/libiconv.a) - SET(ZMQ_INCLUDE_PATH @prefix@/include) SET(ZMQ_LIB @prefix@/lib/libzmq.a) diff --git a/monero b/monero index e39e3e6..14d2ac0 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit e39e3e68ba432846199634baca9c2d3ad0d926cd +Subproject commit 14d2ac095df656745e383258f4434ed4968b1c6b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e453508..42253b3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -288,10 +288,6 @@ if(CHECK_UPDATES) target_link_libraries(feather PRIVATE openpgp) endif() -if(DEPENDS) - target_link_libraries(feather PRIVATE ${ICONV_LIBRARIES}) -endif() - if(DEVICE_TREZOR_READY) find_package(Protobuf CONFIG) if (NOT Protobuf_FOUND) diff --git a/src/polyseed/polyseed.cpp b/src/polyseed/polyseed.cpp index e0e4ad4..0f27d84 100644 --- a/src/polyseed/polyseed.cpp +++ b/src/polyseed/polyseed.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include @@ -15,8 +14,6 @@ namespace polyseed { - static std::locale locale; - static size_t utf8_nfc(const char* str, polyseed_str norm) { auto Qstr = QString(str); auto Qs = Qstr.normalized(QString::NormalizationForm_C); @@ -63,10 +60,6 @@ namespace polyseed { throw std::runtime_error("sodium_init failed"); } - boost::locale::generator gen; - gen.locale_cache_enabled(true); - locale = gen(""); - sodium_memzero(seed, POLYSEED_RANDBYTES); polyseed_dependency pd; From b64089091c05a0cdae0d034ddaac925ccb2c8a69 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 17:58:04 +0200 Subject: [PATCH 29/76] nodes: add plowsof i2p --- src/assets/nodes.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/nodes.json b/src/assets/nodes.json index 296aa66..4e42e55 100644 --- a/src/assets/nodes.json +++ b/src/assets/nodes.json @@ -19,7 +19,10 @@ "rucknium757bokwv3ss35ftgc3gzb7hgbvvglbg3hisp7tsj2fkd2nyd.onion:18081" ], "i2p": [ - "ofrnxmr5ltaazarexs3damrcsldc5p6qlcos3vk25cwdgyjvrueq.b32.i2p:18089" + "ofrnxmr5ltaazarexs3damrcsldc5p6qlcos3vk25cwdgyjvrueq.b32.i2p:18089", + "vdmnehdjkpkg57nthgnjfuaqgku673r5bpbqg56ix6fyqoywgqrq.b32.i2p:18089", + "uqj3aphckqtjsitz7kxx5flqpwjlq5ppr3chazfued7xucv3nheq.b32.i2p:18089", + "ugnlcdciyhghh2zert7c3kl4biwkirc43ke33jiy5slnd3mv2trq.b32.i2p:18089" ], "clearnet": [ "node.community.rino.io:18081", From 23208d98a6f71f4846a1be0ba99c7a9f1a32df1f Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 29 Sep 2024 21:58:40 +0200 Subject: [PATCH 30/76] wizard: fix lookahead validation --- src/wizard/PageSetSubaddressLookahead.cpp | 34 ++++++++++++++++++++--- src/wizard/PageSetSubaddressLookahead.h | 1 + src/wizard/PageSetSubaddressLookahead.ui | 24 ++++++++++++++-- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/wizard/PageSetSubaddressLookahead.cpp b/src/wizard/PageSetSubaddressLookahead.cpp index c6c896a..6d9e05b 100644 --- a/src/wizard/PageSetSubaddressLookahead.cpp +++ b/src/wizard/PageSetSubaddressLookahead.cpp @@ -5,7 +5,9 @@ #include "ui_PageSetSubaddressLookahead.h" #include "WalletWizard.h" -#include +#include + +#include "Icons.h" PageSetSubaddressLookahead::PageSetSubaddressLookahead(WizardFields *fields, QWidget *parent) : QWizardPage(parent) @@ -14,11 +16,19 @@ PageSetSubaddressLookahead::PageSetSubaddressLookahead(WizardFields *fields, QWi { ui->setupUi(this); - // uint32_t can go up to 4294967294, but this isn't realistic - auto indexValidator = new QIntValidator(1, 2147483647, this); + auto *indexValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{0,5}")}; ui->line_major->setValidator(indexValidator); + connect(ui->line_major, &QLineEdit::textChanged, [this]{ + this->completeChanged(); + }); + ui->line_minor->setValidator(indexValidator); + connect(ui->line_major, &QLineEdit::textChanged, [this]{ + this->completeChanged(); + }); + + ui->infoFrame->setInfo(icons()->icon("warning"), "Lookahead must be non-zero."); this->setTitle("Subaddress Lookahead"); } @@ -31,6 +41,7 @@ void PageSetSubaddressLookahead::initializePage() { ui->line_major->setText("50"); ui->line_minor->setText("200"); } + ui->infoFrame->hide(); } bool PageSetSubaddressLookahead::validatePage() { @@ -40,4 +51,19 @@ bool PageSetSubaddressLookahead::validatePage() { int PageSetSubaddressLookahead::nextId() const { return WalletWizard::Page_WalletFile; -} \ No newline at end of file +} + +bool PageSetSubaddressLookahead::isComplete() const { + ui->infoFrame->hide(); + + if (ui->line_major->text().isEmpty() || ui->line_major->text().toInt() == 0) { + ui->infoFrame->show(); + return false; + } + if (ui->line_minor->text().isEmpty() || ui->line_minor->text().toInt() == 0) { + ui->infoFrame->show(); + return false; + } + + return true; +} diff --git a/src/wizard/PageSetSubaddressLookahead.h b/src/wizard/PageSetSubaddressLookahead.h index 04fb4c3..fc7a6d3 100644 --- a/src/wizard/PageSetSubaddressLookahead.h +++ b/src/wizard/PageSetSubaddressLookahead.h @@ -22,6 +22,7 @@ public: void initializePage() override; bool validatePage() override; int nextId() const override; + bool isComplete() const override; private: Ui::PageSetSubaddressLookahead *ui; diff --git a/src/wizard/PageSetSubaddressLookahead.ui b/src/wizard/PageSetSubaddressLookahead.ui index 6fd4d8f..b724fe3 100644 --- a/src/wizard/PageSetSubaddressLookahead.ui +++ b/src/wizard/PageSetSubaddressLookahead.ui @@ -23,6 +23,9 @@ + + + @@ -30,16 +33,31 @@ - - - + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + InfoFrame + QFrame +
components.h
+ 1 +
+
From a53f6d4b2c3b0599e81877c3a6cbf0a16b8cd41b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 02:17:51 +0200 Subject: [PATCH 31/76] main: cleanup argument parsing --- src/main.cpp | 66 +++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 43a9e72..e1512a0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,8 +66,6 @@ void signal_handler(int signum) { int main(int argc, char *argv[]) { - qDebug() << "Reached main"; - Q_INIT_RESOURCE(assets); #if defined(Q_OS_LINUX) && defined(STACK_TRACE) @@ -86,32 +84,42 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { } #endif - QStringList argv_; - for(int i = 0; i != argc; i++){ - argv_ << QString::fromStdString(argv[i]); - } +#if defined(Q_OS_LINUX) + // PassThrough results in muddy text + QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); +#endif + +#if defined(Q_OS_MAC) + // https://github.com/itay-grudev/SingleApplication/issues/136#issuecomment-1925441403 + QApplication app(argc, argv); +#else + SingleApplication app(argc, argv); +#endif + + QApplication::setApplicationName("Feather"); + QApplication::setApplicationVersion(FEATHER_VERSION); QCommandLineParser parser; - parser.setApplicationDescription("feather"); - parser.addHelpOption(); - parser.addVersionOption(); + parser.setApplicationDescription("Feather - a free Monero desktop wallet"); + QCommandLineOption helpOption = parser.addHelpOption(); + QCommandLineOption versionOption = parser.addVersionOption(); - QCommandLineOption useLocalTorOption(QStringList() << "use-local-tor", "Use system wide installed Tor instead of the bundled."); + QCommandLineOption useLocalTorOption("use-local-tor", "Use system wide installed Tor instead of the bundled."); parser.addOption(useLocalTorOption); - QCommandLineOption quietModeOption(QStringList() << "quiet", "Limit console output"); + QCommandLineOption quietModeOption("quiet", "Limit console output"); parser.addOption(quietModeOption); - QCommandLineOption stagenetOption(QStringList() << "stagenet", "Stagenet is for development purposes only."); + QCommandLineOption stagenetOption("stagenet", "Stagenet is for development purposes only."); parser.addOption(stagenetOption); - QCommandLineOption testnetOption(QStringList() << "testnet", "Testnet is for development purposes only."); + QCommandLineOption testnetOption("testnet", "Testnet is for development purposes only."); parser.addOption(testnetOption); - bool parsed = parser.parse(argv_); - if (!parsed) { - qCritical() << parser.errorText(); - exit(1); + parser.process(app); + + if (parser.isSet(versionOption) || parser.isSet(helpOption)) { + return EXIT_SUCCESS; } bool stagenet = parser.isSet(stagenetOption); @@ -126,26 +134,8 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { else constants::networkType = NetworkType::MAINNET; - // Setup QApplication - QApplication::setDesktopSettingsAware(true); // use system font - QApplication::setApplicationVersion(FEATHER_VERSION); - -#if defined(Q_OS_LINUX) - // PassThrough results in muddy text - QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); -#endif - - qDebug() << "Setting up QApplication"; - -#if defined(Q_OS_MAC) - // https://github.com/itay-grudev/SingleApplication/issues/136#issuecomment-1925441403 - QApplication app(argc, argv); -#else - SingleApplication app(argc, argv); -#endif - QApplication::setQuitOnLastWindowClosed(false); - QApplication::setApplicationName("FeatherWallet"); + QApplication::setDesktopSettingsAware(true); // use system font // Setup config directories QString configDir = Config::defaultConfigDir().path(); @@ -254,5 +244,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { }); #endif - return QApplication::exec(); + int exitCode = QApplication::exec(); + qDebug() << "QApplication::exec() returned"; + return exitCode; } From 4b197dd49cb2e7178ad056f7d515711166d33a04 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 04:21:42 +0200 Subject: [PATCH 32/76] remove SingleApplication --- .gitmodules | 3 - src/Application.cpp | 100 ++++++++++++++++++++++++++++++ src/Application.h | 36 +++++++++++ src/CMakeLists.txt | 9 --- src/WindowManager.cpp | 5 +- src/WindowManager.h | 2 +- src/main.cpp | 36 +++-------- src/third-party/singleapplication | 1 - 8 files changed, 150 insertions(+), 42 deletions(-) create mode 100644 src/Application.cpp create mode 100644 src/Application.h delete mode 160000 src/third-party/singleapplication diff --git a/.gitmodules b/.gitmodules index 6187c66..a8c3a3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "monero"] path = monero url = https://github.com/feather-wallet/monero.git -[submodule "src/third-party/singleapplication"] - path = src/third-party/singleapplication - url = https://github.com/itay-grudev/SingleApplication.git [submodule "src/third-party/polyseed"] path = src/third-party/polyseed url = https://github.com/tevador/polyseed.git diff --git a/src/Application.cpp b/src/Application.cpp new file mode 100644 index 0000000..5758662 --- /dev/null +++ b/src/Application.cpp @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2020-2024 The Monero Project + +#include "Application.h" + +#include "config.h" + +#include +#include +#include + +namespace +{ + constexpr int WaitTimeoutMSec = 150; + const char BlockSizeProperty[] = "blockSize"; +} // namespace + +Application::Application(int& argc, char** argv) + : QApplication(argc, argv) + , m_alreadyRunning(false) + , m_lockFile(nullptr) +{ + QString userName = qgetenv("USER"); + if (userName.isEmpty()) { + userName = qgetenv("USERNAME"); + } + QString identifier = "feather"; + if (!userName.isEmpty()) { + identifier += "-" + userName; + } + + QString lockName = identifier + ".lock"; + m_socketName = identifier + ".socket"; + + // According to documentation we should use RuntimeLocation on *nixes, but even Qt doesn't respect + // this and creates sockets in TempLocation, so let's be consistent. + m_lockFile = new QLockFile(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/" + lockName); + m_lockFile->setStaleLockTime(0); + m_lockFile->tryLock(); + + m_lockServer.setSocketOptions(QLocalServer::UserAccessOption); + connect(&m_lockServer, SIGNAL(newConnection()), this, SIGNAL(anotherInstanceStarted())); + connect(&m_lockServer, &QLocalServer::newConnection, this, &Application::processIncomingConnection); + + switch (m_lockFile->error()) { + case QLockFile::NoError: + // No existing lock was found, start listener + m_lockServer.listen(m_socketName); + break; + case QLockFile::LockFailedError: { + // Attempt to connect to the existing instance + QLocalSocket client; + for (int i = 0; i < 3; ++i) { + client.connectToServer(m_socketName); + if (client.waitForConnected(WaitTimeoutMSec)) { + // Connection succeeded, this will raise the existing window if minimized + client.abort(); + m_alreadyRunning = true; + break; + } + } + + if (!m_alreadyRunning) { + // If we get here then the original instance is likely dead + qWarning() << "Existing single-instance lock file is invalid. Launching new instance."; + + // forceably reset the lock file + m_lockFile->removeStaleLockFile(); + m_lockFile->tryLock(); + // start the listen server + m_lockServer.listen(m_socketName); + } + break; + } + default: + qWarning() << "The lock file could not be created. Single-instance mode disabled."; + } +} + +Application::~Application() +{ + if (m_lockFile) { + m_lockFile->unlock(); + delete m_lockFile; + } +} + +bool Application::isAlreadyRunning() const +{ + return m_alreadyRunning; +} + +void Application::processIncomingConnection() +{ + qDebug() << "We got an incoming connection"; + if (m_lockServer.hasPendingConnections()) { + QLocalSocket* socket = m_lockServer.nextPendingConnection(); + socket->setProperty(BlockSizeProperty, 0); + } +} diff --git a/src/Application.h b/src/Application.h new file mode 100644 index 0000000..3600334 --- /dev/null +++ b/src/Application.h @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2020-2024 The Monero Project + +#ifndef FEATHER_APPLICATION_H +#define FEATHER_APPLICATION_H + +#include +#include + +class QLockFile; +class QSocketNotifier; + +class Application : public QApplication { + Q_OBJECT + +public: + Application(int& argc, char** argv); + ~Application() override; + + bool isAlreadyRunning() const; + +signals: + void anotherInstanceStarted(); + +private slots: + void processIncomingConnection(); + +private: + bool m_alreadyRunning; + QLockFile* m_lockFile; + QLocalServer m_lockServer; + QString m_socketName; +}; + + +#endif //FEATHER_APPLICATION_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42253b3..9100de9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,11 +20,6 @@ endif() find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS}) -if (NOT APPLE) - set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") - add_subdirectory(third-party/singleapplication) -endif() - if (CHECK_UPDATES) add_subdirectory(openpgp) endif() @@ -280,10 +275,6 @@ target_link_libraries(feather PRIVATE ${BCUR_LIBRARY} ) -if(NOT APPLE) - target_link_libraries(feather PRIVATE SingleApplication::SingleApplication) -endif() - if(CHECK_UPDATES) target_link_libraries(feather PRIVATE openpgp) endif() diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 6a37a62..2dd5370 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -3,12 +3,12 @@ #include "WindowManager.h" -#include #include #include #include #include +#include "Application.h" #include "constants.h" #include "dialog/PasswordDialog.h" #include "dialog/SplashDialog.h" @@ -33,6 +33,7 @@ WindowManager::WindowManager(QObject *parent) connect(m_walletManager, &WalletManager::deviceError, this, &WindowManager::onDeviceError); connect(m_walletManager, &WalletManager::walletPassphraseNeeded, this, &WindowManager::onWalletPassphraseNeeded); + connect(qApp, SIGNAL(anotherInstanceStarted()), this, SLOT(raise())); connect(qApp, &QGuiApplication::lastWindowClosed, this, &WindowManager::quitAfterLastWindow); m_tray = new QSystemTrayIcon(icons()->icon("appicons/64x64.png")); @@ -66,6 +67,7 @@ WindowManager::~WindowManager() { qDebug() << "~WindowManager"; m_cleanupThread->quit(); m_cleanupThread->wait(); + qDebug() << "Cleanup thread done"; } // ######################## APPLICATION LIFECYCLE ######################## @@ -100,6 +102,7 @@ void WindowManager::close() { torManager()->stop(); + qDebug() << "Calling QApplication::quit()"; QApplication::quit(); } diff --git a/src/WindowManager.h b/src/WindowManager.h index 92c9225..beccd5e 100644 --- a/src/WindowManager.h +++ b/src/WindowManager.h @@ -30,7 +30,6 @@ public: void closeWindow(MainWindow *window); void showWizard(WalletWizard::Page startPage); void restartApplication(const QString &binaryFilename); - void raise(); void showSettings(Nodes *nodes, QWidget *parent, bool showProxyTab = false); @@ -59,6 +58,7 @@ public slots: void tryOpenWallet(const QString &path, const QString &password); private slots: + void raise(); void onWalletOpened(Wallet *wallet); void onWalletCreated(Wallet *wallet); void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path); diff --git a/src/main.cpp b/src/main.cpp index e1512a0..1627805 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,17 +1,9 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include -#include -#include -#include -#if !defined(Q_OS_MAC) -#include -#endif - +#include "Application.h" #include "config-feather.h" #include "constants.h" -#include "MainWindow.h" #include "utils/EventFilter.h" #include "utils/os/Prestium.h" #include "WindowManager.h" @@ -24,8 +16,6 @@ #include #endif -#include - #if defined(Q_OS_WIN) #include #include @@ -89,12 +79,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); #endif -#if defined(Q_OS_MAC) - // https://github.com/itay-grudev/SingleApplication/issues/136#issuecomment-1925441403 - QApplication app(argc, argv); -#else - SingleApplication app(argc, argv); -#endif + Application app(argc, argv); QApplication::setApplicationName("Feather"); QApplication::setApplicationVersion(FEATHER_VERSION); @@ -122,6 +107,11 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { return EXIT_SUCCESS; } + if (app.isAlreadyRunning()) { + qWarning() << "Another instance of Feather is already running"; + return EXIT_SUCCESS; + } + bool stagenet = parser.isSet(stagenetOption); bool testnet = parser.isSet(testnetOption); bool quiet = parser.isSet(quietModeOption); @@ -193,8 +183,6 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { conf()->set(Config::restartRequired, false); - parser.process(app); // Parse again for --help and --version - if (!quiet) { QMap info; info["Qt"] = QT_VERSION_STR; @@ -238,13 +226,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { auto wm = windowManager(); wm->setEventFilter(&filter); -#if !defined(Q_OS_MAC) - QObject::connect(&app, &SingleApplication::instanceStarted, [&wm]() { - wm->raise(); - }); -#endif - - int exitCode = QApplication::exec(); - qDebug() << "QApplication::exec() returned"; + int exitCode = Application::exec(); + qDebug() << "Application::exec() returned"; return exitCode; } diff --git a/src/third-party/singleapplication b/src/third-party/singleapplication deleted file mode 160000 index 3e8e85d..0000000 --- a/src/third-party/singleapplication +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3e8e85d1a487e433751711a8a090659684d42e3b From 37aa04e3e5b642ee7fb2d1a9f024a19a8de47019 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 05:45:21 +0200 Subject: [PATCH 33/76] firehose application shutdown --- src/Application.cpp | 1 + src/MainWindow.cpp | 3 ++- src/WindowManager.cpp | 8 +++++--- src/libwalletqt/Wallet.cpp | 4 ++-- src/libwalletqt/WalletManager.cpp | 1 + src/utils/scheduler.cpp | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 5758662..d4de15f 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -79,6 +79,7 @@ Application::Application(int& argc, char** argv) Application::~Application() { + qDebug() << "~Application"; if (m_lockFile) { m_lockFile->unlock(); delete m_lockFile; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 1bcd07b..fa2b4c2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1207,6 +1207,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { qDebug() << Q_FUNC_INFO; if (!this->cleanedUp) { + qDebug() << "MainWindow: cleaning up"; this->cleanedUp = true; emit aboutToQuit(); @@ -1934,5 +1935,5 @@ int MainWindow::findTab(const QString &title) { } MainWindow::~MainWindow() { - qDebug() << "~MainWindow"; + qDebug() << "~MainWindow" << QThread::currentThreadId(); } \ No newline at end of file diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 2dd5370..d892fec 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -67,7 +67,7 @@ WindowManager::~WindowManager() { qDebug() << "~WindowManager"; m_cleanupThread->quit(); m_cleanupThread->wait(); - qDebug() << "Cleanup thread done"; + qDebug() << "WindowManager: cleanup thread done" << QThread::currentThreadId(); } // ######################## APPLICATION LIFECYCLE ######################## @@ -82,7 +82,7 @@ void WindowManager::quitAfterLastWindow() { } void WindowManager::close() { - qDebug() << Q_FUNC_INFO; + qDebug() << Q_FUNC_INFO << QThread::currentThreadId(); for (const auto &window: m_windows) { window->close(); } @@ -102,12 +102,14 @@ void WindowManager::close() { torManager()->stop(); + deleteLater(); + qDebug() << "Calling QApplication::quit()"; QApplication::quit(); } void WindowManager::closeWindow(MainWindow *window) { - qDebug() << "closing Window"; + qDebug() << "WindowManager: closing Window"; m_windows.removeOne(window); // Move Wallet to a different thread for cleanup, so it doesn't block GUI thread diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 61fb184..b806bd5 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -1431,7 +1431,7 @@ void Wallet::getTxPoolStatsAsync() { Wallet::~Wallet() { - qDebug("~Wallet: Closing wallet"); + qDebug() << "~Wallet: Closing wallet" << QThread::currentThreadId(); pauseRefresh(); m_walletImpl->stop(); @@ -1448,5 +1448,5 @@ Wallet::~Wallet() delete m_walletImpl; m_walletImpl = nullptr; - qDebug("m_walletImpl deleted"); + qDebug() << "m_walletImpl deleted" << QThread::currentThreadId(); } diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index c34fea4..32a4783 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -312,6 +312,7 @@ WalletManager::WalletManager(QObject *parent) WalletManager::~WalletManager() { + qDebug() << "~WalletManager" << QThread::currentThreadId(); m_scheduler.shutdownWaitForFinished(); } diff --git a/src/utils/scheduler.cpp b/src/utils/scheduler.cpp index 4610165..94b40f7 100644 --- a/src/utils/scheduler.cpp +++ b/src/utils/scheduler.cpp @@ -10,6 +10,7 @@ FutureScheduler::FutureScheduler(QObject *parent) FutureScheduler::~FutureScheduler() { + qDebug() << "~FutureScheduler:" << QThread::currentThreadId(); shutdownWaitForFinished(); } From c31b351b173fa8010da0984a0ebe656850b10c41 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 05:47:57 +0200 Subject: [PATCH 34/76] fix a few memory leaks --- src/MainWindow.cpp | 4 ++-- src/MainWindow.h | 9 ++++++--- src/ReceiveWidget.cpp | 2 +- src/libwalletqt/TransactionHistory.cpp | 8 ++++---- src/libwalletqt/rows/TransactionRow.cpp | 13 ++++++++++--- src/libwalletqt/rows/TransactionRow.h | 8 +++++--- src/plugins/xmrig/XMRigWidget.cpp | 2 +- src/widgets/NetworkProxyWidget.cpp | 2 +- src/wizard/PageSetSubaddressLookahead.cpp | 2 +- 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index fa2b4c2..848f1e3 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -323,7 +323,7 @@ void MainWindow::initMenu() { // Show/Hide Coins connect(ui->actionShow_Coins, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map)); - m_tabShowHideMapper["Coins"] = new ToggleTab(ui->tabCoins, "Coins", "Coins", ui->actionShow_Coins); + m_tabShowHideMapper["Coins"] = new ToggleTab(ui->tabCoins, "Coins", "Coins", ui->actionShow_Coins, this); m_tabShowHideSignalMapper->setMapping(ui->actionShow_Coins, "Coins"); // Show/Hide Plugins.. @@ -335,7 +335,7 @@ void MainWindow::initMenu() { auto* pluginAction = new QAction(QString("Show %1").arg(plugin->displayName()), this); ui->menuView->insertAction(plugin->insertFirst() ? ui->actionPlaceholderBegin : ui->actionPlaceholderEnd, pluginAction); connect(pluginAction, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map)); - m_tabShowHideMapper[plugin->displayName()] = new ToggleTab(plugin->tab(), plugin->displayName(), plugin->displayName(), pluginAction); + m_tabShowHideMapper[plugin->displayName()] = new ToggleTab(plugin->tab(), plugin->displayName(), plugin->displayName(), pluginAction, this); m_tabShowHideSignalMapper->setMapping(pluginAction, plugin->displayName()); } ui->actionPlaceholderBegin->setVisible(false); diff --git a/src/MainWindow.h b/src/MainWindow.h index ac9251e..bab68a3 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -51,9 +51,12 @@ namespace Ui { class MainWindow; } -struct ToggleTab { - ToggleTab(QWidget *tab, QString name, QString description, QAction *menuAction) : - tab(tab), key(std::move(name)), name(std::move(description)), menuAction(menuAction) {} +class ToggleTab : QObject { +Q_OBJECT + +public: + ToggleTab(QWidget *tab, QString name, QString description, QAction *menuAction, QObject *parent = nullptr) : + QObject(parent), tab(tab), key(std::move(name)), name(std::move(description)), menuAction(menuAction) {} QWidget *tab; QString key; QString name; diff --git a/src/ReceiveWidget.cpp b/src/ReceiveWidget.cpp index c57e5c9..a463401 100644 --- a/src/ReceiveWidget.cpp +++ b/src/ReceiveWidget.cpp @@ -71,7 +71,7 @@ ReceiveWidget::ReceiveWidget(Wallet *wallet, QWidget *parent) // context menu ui->addresses->setContextMenuPolicy(Qt::CustomContextMenu); - m_showTransactionsAction = new QAction("Show transactions"); + m_showTransactionsAction = new QAction("Show transactions", this); connect(m_showTransactionsAction, &QAction::triggered, this, &ReceiveWidget::onShowTransactions); connect(ui->addresses, &QTreeView::customContextMenuRequested, this, &ReceiveWidget::showContextMenu); connect(ui->addresses, &SubaddressView::copyAddress, this, &ReceiveWidget::copyAddress); diff --git a/src/libwalletqt/TransactionHistory.cpp b/src/libwalletqt/TransactionHistory.cpp index 37ee863..905af2d 100644 --- a/src/libwalletqt/TransactionHistory.cpp +++ b/src/libwalletqt/TransactionHistory.cpp @@ -105,7 +105,7 @@ void TransactionHistory::refresh() if (payment_id.substr(16).find_first_not_of('0') == std::string::npos) payment_id = payment_id.substr(0,16); - auto* t = new TransactionRow(); + auto* t = new TransactionRow(this); t->m_paymentId = QString::fromStdString(payment_id); t->m_coinbase = pd.m_coinbase; t->m_amount = pd.m_amount; @@ -152,7 +152,7 @@ void TransactionHistory::refresh() if (payment_id.substr(16).find_first_not_of('0') == std::string::npos) payment_id = payment_id.substr(0,16); - auto* t = new TransactionRow(); + auto* t = new TransactionRow(this); t->m_paymentId = QString::fromStdString(payment_id); t->m_amount = pd.m_amount_out - change; @@ -206,7 +206,7 @@ void TransactionHistory::refresh() payment_id = payment_id.substr(0,16); bool is_failed = pd.m_state == tools::wallet2::unconfirmed_transfer_details::failed; - auto *t = new TransactionRow(); + auto *t = new TransactionRow(this); t->m_paymentId = QString::fromStdString(payment_id); t->m_amount = pd.m_amount_out - change; @@ -254,7 +254,7 @@ void TransactionHistory::refresh() std::string payment_id = epee::string_tools::pod_to_hex(i->first); if (payment_id.substr(16).find_first_not_of('0') == std::string::npos) payment_id = payment_id.substr(0,16); - auto *t = new TransactionRow(); + auto *t = new TransactionRow(this); t->m_paymentId = QString::fromStdString(payment_id); t->m_amount = pd.m_amount; t->m_balanceDelta = pd.m_amount; diff --git a/src/libwalletqt/rows/TransactionRow.cpp b/src/libwalletqt/rows/TransactionRow.cpp index a4c1b7f..0edb315 100644 --- a/src/libwalletqt/rows/TransactionRow.cpp +++ b/src/libwalletqt/rows/TransactionRow.cpp @@ -6,8 +6,9 @@ #include "Transfer.h" #include "Ring.h" -TransactionRow::TransactionRow() - : m_direction(TransactionRow::Direction_Out) +TransactionRow::TransactionRow(QObject *parent) + : QObject(parent) + , m_direction(TransactionRow::Direction_Out) , m_pending(false) , m_failed(false) , m_coinbase(false) @@ -164,4 +165,10 @@ QString TransactionRow::rings_formatted() const rings += "\n\n"; } return rings; -} \ No newline at end of file +} + +TransactionRow::~TransactionRow() +{ + qDeleteAll(m_transfers); + qDeleteAll(m_rings); +} diff --git a/src/libwalletqt/rows/TransactionRow.h b/src/libwalletqt/rows/TransactionRow.h index 3fb8be4..68b21e2 100644 --- a/src/libwalletqt/rows/TransactionRow.h +++ b/src/libwalletqt/rows/TransactionRow.h @@ -16,6 +16,8 @@ class TransactionRow : public QObject Q_OBJECT public: + ~TransactionRow() override; + enum Direction { Direction_In = 0, Direction_Out = 1, @@ -52,12 +54,12 @@ public: QString rings_formatted() const; private: - explicit TransactionRow(); + explicit TransactionRow(QObject *parent); private: friend class TransactionHistory; - mutable QList m_transfers; - mutable QList m_rings; + QList m_transfers; + QList m_rings; qint64 m_amount; // Amount that was sent (to destinations) or received, excludes tx fee qint64 m_balanceDelta; // How much the total balance was mutated as a result of this tx (includes tx fee) quint64 m_blockHeight; diff --git a/src/plugins/xmrig/XMRigWidget.cpp b/src/plugins/xmrig/XMRigWidget.cpp index 256c1f1..0759514 100644 --- a/src/plugins/xmrig/XMRigWidget.cpp +++ b/src/plugins/xmrig/XMRigWidget.cpp @@ -20,7 +20,7 @@ XMRigWidget::XMRigWidget(Wallet *wallet, QWidget *parent) : QWidget(parent) , ui(new Ui::XMRigWidget) , m_wallet(wallet) - , m_XMRig(new XmRig(Config::defaultConfigDir().path())) + , m_XMRig(new XmRig(Config::defaultConfigDir().path(), this)) , m_model(new QStandardItemModel(this)) , m_contextMenu(new QMenu(this)) { diff --git a/src/widgets/NetworkProxyWidget.cpp b/src/widgets/NetworkProxyWidget.cpp index 35cc1e9..c79b90c 100644 --- a/src/widgets/NetworkProxyWidget.cpp +++ b/src/widgets/NetworkProxyWidget.cpp @@ -37,7 +37,7 @@ NetworkProxyWidget::NetworkProxyWidget(QWidget *parent) connect(ui->line_host, &QLineEdit::textChanged, this, &NetworkProxyWidget::onProxySettingsChanged); // [Port] - auto *portValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]")}; + auto *portValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]"), this}; ui->line_port->setValidator(portValidator); ui->line_port->setText(conf()->get(Config::socks5Port).toString()); connect(ui->line_port, &QLineEdit::textChanged, this, &NetworkProxyWidget::onProxySettingsChanged); diff --git a/src/wizard/PageSetSubaddressLookahead.cpp b/src/wizard/PageSetSubaddressLookahead.cpp index 6d9e05b..f83839a 100644 --- a/src/wizard/PageSetSubaddressLookahead.cpp +++ b/src/wizard/PageSetSubaddressLookahead.cpp @@ -16,7 +16,7 @@ PageSetSubaddressLookahead::PageSetSubaddressLookahead(WizardFields *fields, QWi { ui->setupUi(this); - auto *indexValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{0,5}")}; + auto *indexValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{0,5}"), this}; ui->line_major->setValidator(indexValidator); connect(ui->line_major, &QLineEdit::textChanged, [this]{ From a1836a64b281a767cdf5141669a12f1d0b0f91cc Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 16:36:47 +0200 Subject: [PATCH 35/76] websocket: cleanup before quit --- src/utils/WebsocketClient.cpp | 6 +++++- src/utils/WebsocketNotifier.cpp | 6 +++++- src/utils/WebsocketNotifier.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/utils/WebsocketClient.cpp b/src/utils/WebsocketClient.cpp index 63f0e1d..85b6030 100644 --- a/src/utils/WebsocketClient.cpp +++ b/src/utils/WebsocketClient.cpp @@ -12,6 +12,8 @@ WebsocketClient::WebsocketClient(QObject *parent) : QObject(parent) , webSocket(new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this)) { + connect(qApp, &QCoreApplication::aboutToQuit, this, &WebsocketClient::stop); + connect(webSocket, &QWebSocket::stateChanged, this, &WebsocketClient::onStateChanged); connect(webSocket, &QWebSocket::connected, this, &WebsocketClient::onConnected); connect(webSocket, &QWebSocket::disconnected, this, &WebsocketClient::onDisconnected); @@ -26,7 +28,6 @@ WebsocketClient::WebsocketClient(QObject *parent) } }); m_pingTimer.setInterval(30 * 1000); - m_pingTimer.start(); connect(&m_connectionTimeout, &QTimer::timeout, this, &WebsocketClient::onConnectionTimeout); @@ -67,9 +68,11 @@ void WebsocketClient::restart() { } void WebsocketClient::stop() { + qDebug() << Q_FUNC_INFO; m_stopped = true; webSocket->close(); m_connectionTimeout.stop(); + m_pingTimer.stop(); } void WebsocketClient::onConnected() { @@ -89,6 +92,7 @@ void WebsocketClient::onStateChanged(QAbstractSocket::SocketState state) { } else if (state == QAbstractSocket::ConnectedState) { m_connectionTimeout.stop(); + m_pingTimer.start(); } } diff --git a/src/utils/WebsocketNotifier.cpp b/src/utils/WebsocketNotifier.cpp index 75666cc..b3fbc22 100644 --- a/src/utils/WebsocketNotifier.cpp +++ b/src/utils/WebsocketNotifier.cpp @@ -116,4 +116,8 @@ WebsocketNotifier* WebsocketNotifier::instance() } return m_instance; -} \ No newline at end of file +} + +WebsocketNotifier::~WebsocketNotifier() { + qDebug() << "~WebsocketNotifier" << QThread::currentThreadId(); +} diff --git a/src/utils/WebsocketNotifier.h b/src/utils/WebsocketNotifier.h index ea163fb..f2ee464 100644 --- a/src/utils/WebsocketNotifier.h +++ b/src/utils/WebsocketNotifier.h @@ -18,6 +18,7 @@ class WebsocketNotifier : public QObject { public: explicit WebsocketNotifier(QObject *parent); + ~WebsocketNotifier(); QMap heights; WebsocketClient *websocketClient; From 8ab420b8024f0be3642f3e433bbe99bc5025c7f0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 22:17:54 +0200 Subject: [PATCH 36/76] cleanup includes --- monero | 2 +- src/Application.h | 1 - src/ContactsWidget.cpp | 3 ++ src/ContactsWidget.h | 6 ++-- src/HistoryWidget.cpp | 2 ++ src/HistoryWidget.h | 6 ++-- src/MainWindow.cpp | 3 +- src/ReceiveWidget.cpp | 1 - src/ReceiveWidget.h | 1 - src/SendWidget.h | 2 +- src/SettingsDialog.cpp | 1 + src/SettingsDialog.h | 6 +--- src/WindowManager.cpp | 6 ++++ src/WindowManager.h | 13 ++++--- src/constants.h | 3 +- src/dialog/AboutDialog.cpp | 1 + src/dialog/AboutDialog.h | 3 -- src/dialog/AccountSwitcherDialog.cpp | 1 + src/dialog/AccountSwitcherDialog.h | 4 +-- src/dialog/AddressCheckerIndexDialog.cpp | 1 + src/dialog/AddressCheckerIndexDialog.h | 3 +- src/dialog/BalanceDialog.h | 2 -- src/dialog/DocsDialog.cpp | 1 + src/libwalletqt/Coins.h | 1 - src/libwalletqt/ConstructionInfo.cpp | 1 + src/libwalletqt/ConstructionInfo.h | 5 ++- src/libwalletqt/Input.h | 6 +--- src/libwalletqt/PassphraseHelper.cpp | 6 ++-- src/libwalletqt/PassphraseHelper.h | 4 +-- src/libwalletqt/PendingTransaction.cpp | 2 ++ src/libwalletqt/PendingTransaction.h | 11 +++--- src/libwalletqt/PendingTransactionInfo.cpp | 1 + src/libwalletqt/PendingTransactionInfo.h | 4 +++ src/libwalletqt/Ring.h | 3 -- src/libwalletqt/Subaddress.h | 4 +-- src/libwalletqt/UnsignedTransaction.cpp | 4 ++- src/libwalletqt/UnsignedTransaction.h | 13 ++++--- src/libwalletqt/Wallet.cpp | 23 +++++++++++- src/libwalletqt/Wallet.h | 36 ++++++++++--------- src/libwalletqt/WalletListenerImpl.cpp | 2 +- src/libwalletqt/WalletListenerImpl.h | 2 +- src/libwalletqt/WalletManager.cpp | 3 +- src/libwalletqt/WalletManager.h | 2 -- src/main.cpp | 5 +++ src/model/CoinsModel.h | 5 --- src/model/SubaddressModel.h | 4 --- src/model/TransactionHistoryModel.cpp | 1 - src/plugins/bounties/BountiesWidget.cpp | 1 + src/plugins/crowdfunding/CCSWidget.cpp | 1 + src/plugins/revuo/RevuoWidget.cpp | 2 ++ src/qrcode/scanner/QrCodeScanDialog.cpp | 11 +----- src/qrcode/scanner/QrCodeScanDialog.h | 6 ---- src/qrcode/scanner/QrCodeScanWidget.cpp | 3 ++ src/qrcode/scanner/QrCodeScanWidget.h | 5 ++- src/qrcode/scanner/QrScanThread.cpp | 3 +- src/qrcode/scanner/QrScanThread.h | 6 ---- src/qrcode/scanner/URDialog.cpp | 1 - src/qrcode/scanner/URDialog.h | 2 -- src/qrcode/scanner/URWidget.h | 1 - src/utils/AppData.cpp | 3 ++ src/utils/AppData.h | 1 - src/utils/EventFilter.cpp | 1 - src/utils/EventFilter.h | 1 - src/utils/NetworkManager.cpp | 1 - src/utils/Networking.cpp | 5 +-- src/utils/Seed.cpp | 10 +++++- src/utils/Seed.h | 10 ++---- src/utils/SemanticVersion.h | 1 + src/utils/TorManager.cpp | 3 +- src/utils/TorManager.h | 9 +++-- src/utils/TxFiatHistory.cpp | 3 ++ src/utils/Utils.cpp | 10 +++++- src/utils/Utils.h | 7 ++-- src/utils/WebsocketClient.cpp | 5 ++- src/utils/WebsocketNotifier.cpp | 2 -- src/utils/config.cpp | 4 +++ src/utils/daemonrpc.cpp | 3 ++ src/utils/daemonrpc.h | 1 + src/utils/networktype.h | 7 ++-- src/utils/nodes.cpp | 4 +-- src/utils/nodes.h | 5 +++ src/utils/os/tails.cpp | 4 ++- src/utils/os/tails.h | 2 ++ src/utils/prices.cpp | 5 ++- src/utils/scheduler.h | 4 --- src/utils/updater/Updater.cpp | 1 - src/widgets/UrlListConfigureWidget.h | 1 - src/widgets/WalletUnlockWidget.cpp | 1 + src/widgets/WalletUnlockWidget.h | 3 +- src/wizard/PageHardwareDevice.cpp | 3 +- src/wizard/PageHardwareDevice.h | 5 +-- src/wizard/PageMenu.cpp | 4 +-- src/wizard/PageMenu.h | 5 +-- src/wizard/PageNetwork.cpp | 1 + src/wizard/PageNetwork.h | 5 +-- src/wizard/PageNetworkProxy.cpp | 5 +-- src/wizard/PageOpenWallet.cpp | 1 + src/wizard/PageOpenWallet.h | 4 +-- src/wizard/PageSetPassword.h | 3 +- src/wizard/PageSetRestoreHeight.cpp | 8 +++-- src/wizard/PageSetRestoreHeight.h | 3 +- src/wizard/PageSetSeedPassphrase.h | 3 +- src/wizard/PageSetSubaddressLookahead.h | 3 +- src/wizard/PageWalletFile.h | 5 ++- src/wizard/PageWalletRestoreKeys.h | 6 +--- src/wizard/PageWalletRestoreSeed.cpp | 1 - src/wizard/PageWalletRestoreSeed.h | 6 +--- src/wizard/PageWalletSeed.cpp | 3 +- src/wizard/PageWalletSeed.h | 6 ++-- src/wizard/WalletWizard.cpp | 10 +++--- src/wizard/WalletWizard.h | 2 -- .../OfflineTxSigningWizard.h | 4 +-- .../offline_tx_signing/PageOTS_Import.h | 1 - .../PageOTS_ImportKeyImages.cpp | 1 - .../PageOTS_ImportKeyImages.h | 1 - .../PageOTS_ImportOffline.cpp | 1 - .../PageOTS_ImportSignedTx.cpp | 1 - 117 files changed, 250 insertions(+), 230 deletions(-) diff --git a/monero b/monero index 14d2ac0..5b9a197 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit 14d2ac095df656745e383258f4434ed4968b1c6b +Subproject commit 5b9a197de481409ab3dc4cd25c5a1048d20ca09f diff --git a/src/Application.h b/src/Application.h index 3600334..1e6d89b 100644 --- a/src/Application.h +++ b/src/Application.h @@ -8,7 +8,6 @@ #include class QLockFile; -class QSocketNotifier; class Application : public QApplication { Q_OBJECT diff --git a/src/ContactsWidget.cpp b/src/ContactsWidget.cpp index 9ad508e..106f8bb 100644 --- a/src/ContactsWidget.cpp +++ b/src/ContactsWidget.cpp @@ -7,7 +7,10 @@ #include #include "dialog/ContactsDialog.h" +#include "model/AddressBookModel.h" +#include "model/AddressBookProxyModel.h" #include "libwalletqt/AddressBook.h" +#include "libwalletqt/Wallet.h" #include "libwalletqt/WalletManager.h" #include "utils/Icons.h" #include "utils/Utils.h" diff --git a/src/ContactsWidget.h b/src/ContactsWidget.h index d6c8291..395511b 100644 --- a/src/ContactsWidget.h +++ b/src/ContactsWidget.h @@ -8,9 +8,9 @@ #include #include -#include "model/AddressBookModel.h" -#include "model/AddressBookProxyModel.h" -#include "libwalletqt/Wallet.h" +class AddressBookModel; +class AddressBookProxyModel; +class Wallet; namespace Ui { class ContactsWidget; diff --git a/src/HistoryWidget.cpp b/src/HistoryWidget.cpp index d5e5939..59a0051 100644 --- a/src/HistoryWidget.cpp +++ b/src/HistoryWidget.cpp @@ -8,6 +8,8 @@ #include "dialog/TxInfoDialog.h" #include "dialog/TxProofDialog.h" +#include "model/TransactionHistoryProxyModel.h" +#include "libwalletqt/Wallet.h" #include "libwalletqt/WalletManager.h" #include "utils/config.h" #include "utils/Icons.h" diff --git a/src/HistoryWidget.h b/src/HistoryWidget.h index f387b07..44e7b83 100644 --- a/src/HistoryWidget.h +++ b/src/HistoryWidget.h @@ -7,10 +7,8 @@ #include #include -#include "libwalletqt/Coins.h" -#include "libwalletqt/Wallet.h" -#include "model/TransactionHistoryModel.h" -#include "model/TransactionHistoryProxyModel.h" +class TransactionHistoryProxyModel; +class Wallet; namespace Ui { class HistoryWidget; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 848f1e3..e4944a2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -26,12 +26,13 @@ #include "libwalletqt/AddressBook.h" #include "libwalletqt/rows/CoinsInfo.h" #include "libwalletqt/Transfer.h" +#include "libwalletqt/TransactionHistory.h" +#include "model/AddressBookModel.h" #include "plugins/PluginRegistry.h" #include "utils/AppData.h" #include "utils/AsyncTask.h" #include "utils/ColorScheme.h" #include "utils/Icons.h" -#include "utils/SemanticVersion.h" #include "utils/TorManager.h" #include "utils/WebsocketNotifier.h" diff --git a/src/ReceiveWidget.cpp b/src/ReceiveWidget.cpp index a463401..39aa24b 100644 --- a/src/ReceiveWidget.cpp +++ b/src/ReceiveWidget.cpp @@ -5,7 +5,6 @@ #include "ui_ReceiveWidget.h" #include -#include #include "dialog/PaymentRequestDialog.h" #include "dialog/QrCodeDialog.h" diff --git a/src/ReceiveWidget.h b/src/ReceiveWidget.h index 43be717..28c6e79 100644 --- a/src/ReceiveWidget.h +++ b/src/ReceiveWidget.h @@ -6,7 +6,6 @@ #include #include -#include #include "libwalletqt/Subaddress.h" #include "libwalletqt/Wallet.h" diff --git a/src/SendWidget.h b/src/SendWidget.h index 1fece10..1b310f2 100644 --- a/src/SendWidget.h +++ b/src/SendWidget.h @@ -6,7 +6,7 @@ #include -#include "libwalletqt/Wallet.h" +class Wallet; namespace Ui { class SendWidget; diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index cbdd3d3..2f52a8a 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -12,6 +12,7 @@ #include "libwalletqt/WalletManager.h" #include "utils/AppData.h" #include "utils/Icons.h" +#include "utils/nodes.h" #include "utils/WebsocketNotifier.h" #include "widgets/NetworkProxyWidget.h" #include "WindowManager.h" diff --git a/src/SettingsDialog.h b/src/SettingsDialog.h index 604dd9c..3630439 100644 --- a/src/SettingsDialog.h +++ b/src/SettingsDialog.h @@ -4,17 +4,13 @@ #ifndef FEATHER_SettingsDIALOG_H #define FEATHER_SettingsDIALOG_H - -#include #include -#include - -#include "widgets/NodeWidget.h" namespace Ui { class Settings; } +class Nodes; class Settings : public QDialog { Q_OBJECT diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index d892fec..dbd022a 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -10,14 +10,20 @@ #include "Application.h" #include "constants.h" +#include "MainWindow.h" +#include "dialog/DocsDialog.h" #include "dialog/PasswordDialog.h" #include "dialog/SplashDialog.h" +#include "dialog/TorInfoDialog.h" +#include "libwalletqt/WalletManager.h" +#include "libwalletqt/Wallet.h" #include "utils/Icons.h" #include "utils/NetworkManager.h" #include "utils/os/tails.h" #include "utils/os/whonix.h" #include "utils/TorManager.h" #include "utils/WebsocketNotifier.h" +#include "utils/AppData.h" WindowManager::WindowManager(QObject *parent) : QObject(parent) diff --git a/src/WindowManager.h b/src/WindowManager.h index beccd5e..a694ef7 100644 --- a/src/WindowManager.h +++ b/src/WindowManager.h @@ -5,17 +5,20 @@ #define FEATHER_WINDOWMANAGER_H #include +#include -#include "dialog/DocsDialog.h" -#include "dialog/TorInfoDialog.h" -#include "libwalletqt/WalletManager.h" -#include "libwalletqt/Wallet.h" -#include "MainWindow.h" +#include "utils/EventFilter.h" #include "utils/nodes.h" #include "wizard/WalletWizard.h" #include "Utils.h" class MainWindow; +class DocsDialog; +class TorInfoDialog; +class WalletManager; +class Wallet; +class SplashDialog; + class WindowManager : public QObject { Q_OBJECT diff --git a/src/constants.h b/src/constants.h index 2e01b22..65e3c24 100644 --- a/src/constants.h +++ b/src/constants.h @@ -4,8 +4,7 @@ #ifndef FEATHER_CONSTANTS_H #define FEATHER_CONSTANTS_H -#include -#include +#include #include "networktype.h" diff --git a/src/dialog/AboutDialog.cpp b/src/dialog/AboutDialog.cpp index 354879e..3ca0ca9 100644 --- a/src/dialog/AboutDialog.cpp +++ b/src/dialog/AboutDialog.cpp @@ -5,6 +5,7 @@ #include "ui_AboutDialog.h" #include +#include #include "config-feather.h" #include "utils/Utils.h" diff --git a/src/dialog/AboutDialog.h b/src/dialog/AboutDialog.h index e882046..b07312c 100644 --- a/src/dialog/AboutDialog.h +++ b/src/dialog/AboutDialog.h @@ -4,9 +4,6 @@ #ifndef FEATHER_ABOUT_H #define FEATHER_ABOUT_H -#include -#include - #include "components.h" namespace Ui { diff --git a/src/dialog/AccountSwitcherDialog.cpp b/src/dialog/AccountSwitcherDialog.cpp index 4c3a6a6..c907c21 100644 --- a/src/dialog/AccountSwitcherDialog.cpp +++ b/src/dialog/AccountSwitcherDialog.cpp @@ -8,6 +8,7 @@ #include "libwalletqt/SubaddressAccount.h" #include "libwalletqt/WalletManager.h" +#include "model/SubaddressAccountModel.h" #include "utils/Icons.h" #include "utils/Utils.h" diff --git a/src/dialog/AccountSwitcherDialog.h b/src/dialog/AccountSwitcherDialog.h index 1d3dcef..eef7b1a 100644 --- a/src/dialog/AccountSwitcherDialog.h +++ b/src/dialog/AccountSwitcherDialog.h @@ -4,10 +4,8 @@ #ifndef FEATHER_ACCOUNTSWITCHERDIALOG_H #define FEATHER_ACCOUNTSWITCHERDIALOG_H -#include - -#include "libwalletqt/Wallet.h" #include "components.h" +#include "libwalletqt/Wallet.h" #include "model/SubaddressAccountModel.h" namespace Ui { diff --git a/src/dialog/AddressCheckerIndexDialog.cpp b/src/dialog/AddressCheckerIndexDialog.cpp index ae4e369..ce1670f 100644 --- a/src/dialog/AddressCheckerIndexDialog.cpp +++ b/src/dialog/AddressCheckerIndexDialog.cpp @@ -7,6 +7,7 @@ #include "utils/Utils.h" #include "components.h" #include "dialog/QrCodeDialog.h" +#include "libwalletqt/Wallet.h" AddressCheckerIndexDialog::AddressCheckerIndexDialog(Wallet *wallet, QWidget *parent) : WindowModalDialog(parent) diff --git a/src/dialog/AddressCheckerIndexDialog.h b/src/dialog/AddressCheckerIndexDialog.h index 6ab397a..b4777c8 100644 --- a/src/dialog/AddressCheckerIndexDialog.h +++ b/src/dialog/AddressCheckerIndexDialog.h @@ -5,7 +5,8 @@ #define ADDRESSCHECKERINDEXDIALOG_H #include "components.h" -#include "Wallet.h" + +class Wallet; namespace Ui { class AddressCheckerIndexDialog; diff --git a/src/dialog/BalanceDialog.h b/src/dialog/BalanceDialog.h index 7592713..f62e08b 100644 --- a/src/dialog/BalanceDialog.h +++ b/src/dialog/BalanceDialog.h @@ -4,8 +4,6 @@ #ifndef FEATHER_BALANCEDIALOG_H #define FEATHER_BALANCEDIALOG_H -#include - #include "components.h" #include "libwalletqt/Wallet.h" diff --git a/src/dialog/DocsDialog.cpp b/src/dialog/DocsDialog.cpp index f6ffb78..c86d2f8 100644 --- a/src/dialog/DocsDialog.cpp +++ b/src/dialog/DocsDialog.cpp @@ -5,6 +5,7 @@ #include "ui_DocsDialog.h" #include +#include #include "utils/Utils.h" #include "ColorScheme.h" diff --git a/src/libwalletqt/Coins.h b/src/libwalletqt/Coins.h index 4c6b252..ce875c0 100644 --- a/src/libwalletqt/Coins.h +++ b/src/libwalletqt/Coins.h @@ -9,7 +9,6 @@ #include #include #include -#include #include "Wallet.h" diff --git a/src/libwalletqt/ConstructionInfo.cpp b/src/libwalletqt/ConstructionInfo.cpp index 588b04a..d35a4e0 100644 --- a/src/libwalletqt/ConstructionInfo.cpp +++ b/src/libwalletqt/ConstructionInfo.cpp @@ -5,6 +5,7 @@ #include "Input.h" #include "Transfer.h" +#include quint64 ConstructionInfo::unlockTime() const { return m_unlockTime; diff --git a/src/libwalletqt/ConstructionInfo.h b/src/libwalletqt/ConstructionInfo.h index 9f044d7..906343c 100644 --- a/src/libwalletqt/ConstructionInfo.h +++ b/src/libwalletqt/ConstructionInfo.h @@ -4,13 +4,16 @@ #ifndef FEATHER_CONSTRUCTIONINFO_H #define FEATHER_CONSTRUCTIONINFO_H -#include #include #include class Input; class Transfer; +namespace Monero { + class TransactionConstructionInfo; +} + class ConstructionInfo : public QObject { Q_OBJECT diff --git a/src/libwalletqt/Input.h b/src/libwalletqt/Input.h index 1699b03..756fb72 100644 --- a/src/libwalletqt/Input.h +++ b/src/libwalletqt/Input.h @@ -4,15 +4,11 @@ #ifndef FEATHER_INPUT_H #define FEATHER_INPUT_H -#include #include -#include class Input : public QObject { Q_OBJECT - Q_PROPERTY(quint64 amount READ amount) - Q_PROPERTY(QString pubKey READ pubKey) private: explicit Input(uint64_t _amount, QString _address, QObject *parent = nullptr): QObject(parent), m_amount(_amount), m_pubkey(std::move(_address)) {}; @@ -20,10 +16,10 @@ private: friend class ConstructionInfo; quint64 m_amount; QString m_pubkey; + public: quint64 amount() const { return m_amount; } QString pubKey() const { return m_pubkey; } - }; #endif //FEATHER_INPUT_H diff --git a/src/libwalletqt/PassphraseHelper.cpp b/src/libwalletqt/PassphraseHelper.cpp index 747a20b..fe1d94c 100644 --- a/src/libwalletqt/PassphraseHelper.cpp +++ b/src/libwalletqt/PassphraseHelper.cpp @@ -4,7 +4,7 @@ #include "PassphraseHelper.h" #include -Monero::optional PassphraseHelper::onDevicePassphraseRequest(bool & on_device) +std::optional PassphraseHelper::onDevicePassphraseRequest(bool & on_device) { qDebug() << __FUNCTION__; QMutexLocker locker(&m_mutex_pass); @@ -26,9 +26,9 @@ Monero::optional PassphraseHelper::onDevicePassphraseRequest(bool & if (!on_device) { auto tmpPass = m_passphrase.toStdString(); m_passphrase = QString(); - return Monero::optional(tmpPass); + return std::optional(tmpPass); } else { - return Monero::optional(); + return std::optional(); } } diff --git a/src/libwalletqt/PassphraseHelper.h b/src/libwalletqt/PassphraseHelper.h index 745ce50..8b082fa 100644 --- a/src/libwalletqt/PassphraseHelper.h +++ b/src/libwalletqt/PassphraseHelper.h @@ -4,11 +4,9 @@ #ifndef MONERO_GUI_PASSPHRASEHELPER_H #define MONERO_GUI_PASSPHRASEHELPER_H -#include #include #include #include -#include /** * Implements component responsible for showing entry prompt to the user, @@ -32,7 +30,7 @@ class PassphraseHelper { public: PassphraseHelper(PassphrasePrompter * prompter=nullptr): m_prompter(prompter) {}; PassphraseHelper(const PassphraseHelper & h): PassphraseHelper(h.m_prompter) {}; - Monero::optional onDevicePassphraseRequest(bool & on_device); + std::optional onDevicePassphraseRequest(bool & on_device); void onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort); private: diff --git a/src/libwalletqt/PendingTransaction.cpp b/src/libwalletqt/PendingTransaction.cpp index 85e751d..a2ce6a5 100644 --- a/src/libwalletqt/PendingTransaction.cpp +++ b/src/libwalletqt/PendingTransaction.cpp @@ -5,6 +5,8 @@ #include +#include + PendingTransaction::Status PendingTransaction::status() const { return static_cast(m_pimpl->status()); diff --git a/src/libwalletqt/PendingTransaction.h b/src/libwalletqt/PendingTransaction.h index 754cfcd..c5fe083 100644 --- a/src/libwalletqt/PendingTransaction.h +++ b/src/libwalletqt/PendingTransaction.h @@ -7,18 +7,21 @@ #include #include -#include #include "PendingTransactionInfo.h" +namespace Monero { + class PendingTransaction; +} + class PendingTransaction : public QObject { Q_OBJECT public: enum Status { - Status_Ok = Monero::PendingTransaction::Status_Ok, - Status_Error = Monero::PendingTransaction::Status_Error, - Status_Critical = Monero::PendingTransaction::Status_Critical + Status_Ok = 0, + Status_Error = 1, + Status_Critical = 2 }; Q_ENUM(Status) diff --git a/src/libwalletqt/PendingTransactionInfo.cpp b/src/libwalletqt/PendingTransactionInfo.cpp index f8fb458..cba246d 100644 --- a/src/libwalletqt/PendingTransactionInfo.cpp +++ b/src/libwalletqt/PendingTransactionInfo.cpp @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "PendingTransactionInfo.h" +#include quint64 PendingTransactionInfo::fee() const { return m_fee; diff --git a/src/libwalletqt/PendingTransactionInfo.h b/src/libwalletqt/PendingTransactionInfo.h index 48135e3..807edbe 100644 --- a/src/libwalletqt/PendingTransactionInfo.h +++ b/src/libwalletqt/PendingTransactionInfo.h @@ -11,6 +11,10 @@ class Input; class Transfer; +namespace Monero { + class PendingTransactionInfo; +} + class PendingTransactionInfo : public ConstructionInfo { Q_OBJECT diff --git a/src/libwalletqt/Ring.h b/src/libwalletqt/Ring.h index 6e1564f..f81b547 100644 --- a/src/libwalletqt/Ring.h +++ b/src/libwalletqt/Ring.h @@ -4,10 +4,7 @@ #ifndef FEATHER_RINGS_H #define FEATHER_RINGS_H -#include #include -#include -#include class Ring : public QObject { diff --git a/src/libwalletqt/Subaddress.h b/src/libwalletqt/Subaddress.h index fe7571c..4ea30df 100644 --- a/src/libwalletqt/Subaddress.h +++ b/src/libwalletqt/Subaddress.h @@ -4,10 +4,8 @@ #ifndef SUBADDRESS_H #define SUBADDRESS_H -#include - -#include #include +#include #include #include diff --git a/src/libwalletqt/UnsignedTransaction.cpp b/src/libwalletqt/UnsignedTransaction.cpp index c8b56de..14489ec 100644 --- a/src/libwalletqt/UnsignedTransaction.cpp +++ b/src/libwalletqt/UnsignedTransaction.cpp @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "UnsignedTransaction.h" -#include + +#include "ConstructionInfo.h" +#include UnsignedTransaction::Status UnsignedTransaction::status() const { diff --git a/src/libwalletqt/UnsignedTransaction.h b/src/libwalletqt/UnsignedTransaction.h index 33e8723..0677593 100644 --- a/src/libwalletqt/UnsignedTransaction.h +++ b/src/libwalletqt/UnsignedTransaction.h @@ -6,7 +6,12 @@ #include -#include "libwalletqt/PendingTransactionInfo.h" +namespace Monero { + class UnsignedTransaction; + class Wallet; +} + +class ConstructionInfo; class UnsignedTransaction : public QObject { @@ -14,9 +19,9 @@ class UnsignedTransaction : public QObject public: enum Status { - Status_Ok = Monero::UnsignedTransaction::Status_Ok, - Status_Error = Monero::UnsignedTransaction::Status_Error, - Status_Critical = Monero::UnsignedTransaction::Status_Critical + Status_Ok = 0, + Status_Error = 1, + Status_Critical = 2 }; Q_ENUM(Status) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index b806bd5..770718a 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -12,6 +12,7 @@ #include "SubaddressAccount.h" #include "TransactionHistory.h" #include "WalletManager.h" +#include "WalletListenerImpl.h" #include "config.h" #include "constants.h" @@ -357,6 +358,22 @@ void Wallet::setSeedLanguage(const QString &lang) m_wallet2->set_seed_language(lang.toStdString()); } +QString Wallet::getSecretViewKey() const { + return QString::fromStdString(m_walletImpl->secretViewKey()); +} + +QString Wallet::getPublicViewKey() const { + return QString::fromStdString(m_walletImpl->publicViewKey()); +} + +QString Wallet::getSecretSpendKey() const { + return QString::fromStdString(m_walletImpl->secretSpendKey()); +} + +QString Wallet::getPublicSpendKey() const { + return QString::fromStdString(m_walletImpl->publicSpendKey()); +} + // #################### Node connection #################### void Wallet::setOffline(bool offline) { @@ -866,7 +883,7 @@ void Wallet::createTransaction(const QString &address, quint64 amount, const QSt m_scheduler.run([this, all, address, amount, feeLevel, subtractFeeFromAmount] { std::set subaddr_indices; - Monero::PendingTransaction *ptImpl = m_walletImpl->createTransaction(address.toStdString(), "", all ? Monero::optional() : Monero::optional(amount), constants::mixin, + Monero::PendingTransaction *ptImpl = m_walletImpl->createTransaction(address.toStdString(), "", all ? std::optional() : std::optional(amount), constants::mixin, static_cast(feeLevel), currentSubaddressAccount(), subaddr_indices, m_selectedInputs, subtractFeeFromAmount); @@ -1331,6 +1348,10 @@ bool Wallet::setRingDatabase(const QString &path) { return m_walletImpl->setRingDatabase(path.toStdString()); } +quint64 Wallet::getWalletCreationHeight() const { + return m_walletImpl->getRefreshFromBlockHeight(); +} + void Wallet::setWalletCreationHeight(quint64 height) { m_wallet2->set_refresh_from_block_height(height); } diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index bf5636b..2da7baf 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -4,24 +4,28 @@ #ifndef WALLET_H #define WALLET_H -#include #include #include -#include -#include #include "utils/scheduler.h" #include "PendingTransaction.h" #include "UnsignedTransaction.h" #include "utils/networktype.h" #include "PassphraseHelper.h" -#include "WalletListenerImpl.h" #include "rows/TxBacklogEntry.h" +#include + +class WalletListenerImpl; + namespace Monero { struct Wallet; // forward declaration } +namespace tools { + struct wallet2; +} + struct TxProof { TxProof(QString proof, QString error = "") : proof(std::move(proof)), error(std::move(error)){} @@ -94,17 +98,17 @@ public: ~Wallet() override; enum Status { - Status_Ok = Monero::Wallet::Status_Ok, - Status_Error = Monero::Wallet::Status_Error, - Status_Critical = Monero::Wallet::Status_Critical, - Status_BadPassword = Monero::Wallet::Status_BadPassword + Status_Ok = 0, + Status_Error = 1, + Status_Critical = 2, + Status_BadPassword = 3 }; Q_ENUM(Status) enum ConnectionStatus { - ConnectionStatus_Disconnected = Monero::Wallet::ConnectionStatus_Disconnected, - ConnectionStatus_WrongVersion = Monero::Wallet::ConnectionStatus_WrongVersion, + ConnectionStatus_Disconnected = 0, + ConnectionStatus_WrongVersion = 2, ConnectionStatus_Connecting = 9, ConnectionStatus_Synchronizing = 10, ConnectionStatus_Synchronized = 11 @@ -186,10 +190,10 @@ public: void setSeedLanguage(const QString &lang); //! Get wallet keys - QString getSecretViewKey() const {return QString::fromStdString(m_walletImpl->secretViewKey());} - QString getPublicViewKey() const {return QString::fromStdString(m_walletImpl->publicViewKey());} - QString getSecretSpendKey() const {return QString::fromStdString(m_walletImpl->secretSpendKey());} - QString getPublicSpendKey() const {return QString::fromStdString(m_walletImpl->publicSpendKey());} + QString getSecretViewKey() const; + QString getPublicViewKey() const; + QString getSecretSpendKey() const; + QString getPublicSpendKey() const; // ##### Node connection ##### @@ -399,7 +403,7 @@ public: bool setRingDatabase(const QString &path); - quint64 getWalletCreationHeight() const {return m_walletImpl->getRefreshFromBlockHeight();} + quint64 getWalletCreationHeight() const; void setWalletCreationHeight(quint64 height); //! Rescan spent outputs @@ -529,6 +533,4 @@ private: std::set m_selectedInputs; }; - - #endif // WALLET_H diff --git a/src/libwalletqt/WalletListenerImpl.cpp b/src/libwalletqt/WalletListenerImpl.cpp index 5407be8..2f62589 100644 --- a/src/libwalletqt/WalletListenerImpl.cpp +++ b/src/libwalletqt/WalletListenerImpl.cpp @@ -85,7 +85,7 @@ void WalletListenerImpl::onPassphraseEntered(const QString &passphrase, bool ent m_phelper.onPassphraseEntered(passphrase, enter_on_device, entry_abort); } -Monero::optional WalletListenerImpl::onDevicePassphraseRequest(bool & on_device) +std::optional WalletListenerImpl::onDevicePassphraseRequest(bool & on_device) { qDebug() << __FUNCTION__; return m_phelper.onDevicePassphraseRequest(on_device); diff --git a/src/libwalletqt/WalletListenerImpl.h b/src/libwalletqt/WalletListenerImpl.h index 67d91ea..da0ba11 100644 --- a/src/libwalletqt/WalletListenerImpl.h +++ b/src/libwalletqt/WalletListenerImpl.h @@ -35,7 +35,7 @@ public: virtual void onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort) override; - virtual Monero::optional onDevicePassphraseRequest(bool & on_device) override; + virtual std::optional onDevicePassphraseRequest(bool & on_device) override; private: Wallet * m_wallet; diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 32a4783..92ffe8a 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -5,6 +5,7 @@ #include "Wallet.h" #include "utils/ScopeGuard.h" +#include class WalletPassphraseListenerImpl : public Monero::WalletListener, public PassphraseReceiver { @@ -24,7 +25,7 @@ public: m_phelper.onPassphraseEntered(passphrase, enter_on_device, entry_abort); } - Monero::optional onDevicePassphraseRequest(bool & on_device) override + std::optional onDevicePassphraseRequest(bool & on_device) override { qDebug() << __FUNCTION__; return m_phelper.onDevicePassphraseRequest(on_device); diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h index 596a03f..2a43cfc 100644 --- a/src/libwalletqt/WalletManager.h +++ b/src/libwalletqt/WalletManager.h @@ -4,8 +4,6 @@ #ifndef WALLETMANAGER_H #define WALLETMANAGER_H -#include - #include #include #include diff --git a/src/main.cpp b/src/main.cpp index 1627805..ed516db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project +#include + #include "Application.h" #include "config-feather.h" #include "constants.h" @@ -8,6 +10,9 @@ #include "utils/os/Prestium.h" #include "WindowManager.h" #include "config.h" +#include +#include "libwalletqt/Wallet.h" +#include "libwalletqt/WalletManager.h" #if defined(Q_OS_LINUX) && defined(STACK_TRACE) #define BOOST_STACKTRACE_LINK diff --git a/src/model/CoinsModel.h b/src/model/CoinsModel.h index d42bbba..39cf4dc 100644 --- a/src/model/CoinsModel.h +++ b/src/model/CoinsModel.h @@ -4,12 +4,7 @@ #ifndef FEATHER_COINSMODEL_H #define FEATHER_COINSMODEL_H -#include - #include -#include -#include -#include class Coins; class CoinsInfo; diff --git a/src/model/SubaddressModel.h b/src/model/SubaddressModel.h index 9ee3cfb..4d0fe97 100644 --- a/src/model/SubaddressModel.h +++ b/src/model/SubaddressModel.h @@ -4,11 +4,7 @@ #ifndef SUBADDRESSMODEL_H #define SUBADDRESSMODEL_H -#include - #include -#include -#include #include "rows/SubaddressRow.h" diff --git a/src/model/TransactionHistoryModel.cpp b/src/model/TransactionHistoryModel.cpp index 1cbc17b..932b43d 100644 --- a/src/model/TransactionHistoryModel.cpp +++ b/src/model/TransactionHistoryModel.cpp @@ -5,7 +5,6 @@ #include "TransactionHistory.h" #include "constants.h" #include "utils/config.h" -#include "utils/ColorScheme.h" #include "utils/Icons.h" #include "utils/AppData.h" #include "utils/Utils.h" diff --git a/src/plugins/bounties/BountiesWidget.cpp b/src/plugins/bounties/BountiesWidget.cpp index d9322c4..2a12198 100644 --- a/src/plugins/bounties/BountiesWidget.cpp +++ b/src/plugins/bounties/BountiesWidget.cpp @@ -5,6 +5,7 @@ #include "ui_BountiesWidget.h" #include +#include #include "BountiesModel.h" #include "utils/Utils.h" diff --git a/src/plugins/crowdfunding/CCSWidget.cpp b/src/plugins/crowdfunding/CCSWidget.cpp index 0ec9e57..6a50eb4 100644 --- a/src/plugins/crowdfunding/CCSWidget.cpp +++ b/src/plugins/crowdfunding/CCSWidget.cpp @@ -5,6 +5,7 @@ #include "ui_CCSWidget.h" #include +#include #include "CCSProgressDelegate.h" #include "utils/Utils.h" diff --git a/src/plugins/revuo/RevuoWidget.cpp b/src/plugins/revuo/RevuoWidget.cpp index 64581c4..a2442e3 100644 --- a/src/plugins/revuo/RevuoWidget.cpp +++ b/src/plugins/revuo/RevuoWidget.cpp @@ -4,6 +4,8 @@ #include "RevuoWidget.h" #include "ui_RevuoWidget.h" +#include + #include "utils/ColorScheme.h" #include "Utils.h" #include "utils/WebsocketNotifier.h" diff --git a/src/qrcode/scanner/QrCodeScanDialog.cpp b/src/qrcode/scanner/QrCodeScanDialog.cpp index c1e7852..36a7805 100644 --- a/src/qrcode/scanner/QrCodeScanDialog.cpp +++ b/src/qrcode/scanner/QrCodeScanDialog.cpp @@ -4,15 +4,6 @@ #include "QrCodeScanDialog.h" #include "ui_QrCodeScanDialog.h" -#include -#include -#include -#include -#include -#include - -#include "Utils.h" - QrCodeScanDialog::QrCodeScanDialog(QWidget *parent, bool scan_ur) : QDialog(parent) , ui(new Ui::QrCodeScanDialog) @@ -34,4 +25,4 @@ QString QrCodeScanDialog::decodedString() { QrCodeScanDialog::~QrCodeScanDialog() { -} \ No newline at end of file +} diff --git a/src/qrcode/scanner/QrCodeScanDialog.h b/src/qrcode/scanner/QrCodeScanDialog.h index 5f0668b..307ad13 100644 --- a/src/qrcode/scanner/QrCodeScanDialog.h +++ b/src/qrcode/scanner/QrCodeScanDialog.h @@ -5,13 +5,7 @@ #define FEATHER_QRCODESCANDIALOG_H #include -#include #include -#include -#include -#include - -#include "QrScanThread.h" namespace Ui { class QrCodeScanDialog; diff --git a/src/qrcode/scanner/QrCodeScanWidget.cpp b/src/qrcode/scanner/QrCodeScanWidget.cpp index e1d9418..27d3f73 100644 --- a/src/qrcode/scanner/QrCodeScanWidget.cpp +++ b/src/qrcode/scanner/QrCodeScanWidget.cpp @@ -8,8 +8,11 @@ #include #include +#include + #include "utils/config.h" #include "utils/Icons.h" +#include "QrScanThread.h" QrCodeScanWidget::QrCodeScanWidget(QWidget *parent) : QWidget(parent) diff --git a/src/qrcode/scanner/QrCodeScanWidget.h b/src/qrcode/scanner/QrCodeScanWidget.h index 700c316..6d16358 100644 --- a/src/qrcode/scanner/QrCodeScanWidget.h +++ b/src/qrcode/scanner/QrCodeScanWidget.h @@ -11,11 +11,10 @@ #include #include -#include "QrScanThread.h" - -#include #include +class QrScanThread; + namespace Ui { class QrCodeScanWidget; } diff --git a/src/qrcode/scanner/QrScanThread.cpp b/src/qrcode/scanner/QrScanThread.cpp index 8551884..0265cfc 100644 --- a/src/qrcode/scanner/QrScanThread.cpp +++ b/src/qrcode/scanner/QrScanThread.cpp @@ -2,10 +2,11 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "QrScanThread.h" -#include #include +#include "utils/QrCodeUtils.h" + QrScanThread::QrScanThread(QObject *parent) : QThread(parent) , m_running(true) diff --git a/src/qrcode/scanner/QrScanThread.h b/src/qrcode/scanner/QrScanThread.h index 50d227e..4e0eaca 100644 --- a/src/qrcode/scanner/QrScanThread.h +++ b/src/qrcode/scanner/QrScanThread.h @@ -7,12 +7,6 @@ #include #include #include -#include -#include - -#include - -#include "qrcode/utils/QrCodeUtils.h" class QrScanThread : public QThread { diff --git a/src/qrcode/scanner/URDialog.cpp b/src/qrcode/scanner/URDialog.cpp index a0226a7..926879b 100644 --- a/src/qrcode/scanner/URDialog.cpp +++ b/src/qrcode/scanner/URDialog.cpp @@ -8,7 +8,6 @@ #include #include "utils/Utils.h" -#include "WalletManager.h" URDialog::URDialog(QWidget *parent) : WindowModalDialog(parent) diff --git a/src/qrcode/scanner/URDialog.h b/src/qrcode/scanner/URDialog.h index 1ef5791..d24785d 100644 --- a/src/qrcode/scanner/URDialog.h +++ b/src/qrcode/scanner/URDialog.h @@ -4,8 +4,6 @@ #ifndef FEATHER_URDIALOG_H #define FEATHER_URDIALOG_H -#include - #include "components.h" namespace Ui { diff --git a/src/qrcode/scanner/URWidget.h b/src/qrcode/scanner/URWidget.h index da56bbe..b64b1ee 100644 --- a/src/qrcode/scanner/URWidget.h +++ b/src/qrcode/scanner/URWidget.h @@ -8,7 +8,6 @@ #include #include "qrcode/QrCode.h" -#include "widgets/QrCodeWidget.h" #include namespace Ui { diff --git a/src/utils/AppData.cpp b/src/utils/AppData.cpp index 08b5d35..6510321 100644 --- a/src/utils/AppData.cpp +++ b/src/utils/AppData.cpp @@ -2,6 +2,9 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "AppData.h" + +#include + #include "config.h" #include "WebsocketNotifier.h" diff --git a/src/utils/AppData.h b/src/utils/AppData.h index 95f5020..701a018 100644 --- a/src/utils/AppData.h +++ b/src/utils/AppData.h @@ -6,7 +6,6 @@ #include #include -#include #include "prices.h" #include "TxFiatHistory.h" diff --git a/src/utils/EventFilter.cpp b/src/utils/EventFilter.cpp index 7c018f2..3419fee 100644 --- a/src/utils/EventFilter.cpp +++ b/src/utils/EventFilter.cpp @@ -4,7 +4,6 @@ #include "EventFilter.h" #include -#include EventFilter::EventFilter(QObject *parent) : QObject(parent) diff --git a/src/utils/EventFilter.h b/src/utils/EventFilter.h index f759b1d..8c99fa5 100644 --- a/src/utils/EventFilter.h +++ b/src/utils/EventFilter.h @@ -16,7 +16,6 @@ public: protected: bool eventFilter(QObject *obj, QEvent *ev); - signals: void userActivity(); }; diff --git a/src/utils/NetworkManager.cpp b/src/utils/NetworkManager.cpp index c988ae7..04f6eda 100644 --- a/src/utils/NetworkManager.cpp +++ b/src/utils/NetworkManager.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include "utils/config.h" diff --git a/src/utils/Networking.cpp b/src/utils/Networking.cpp index 6be6cdc..a25a9c6 100644 --- a/src/utils/Networking.cpp +++ b/src/utils/Networking.cpp @@ -1,11 +1,12 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project +#include "utils/Networking.h" + #include #include +#include -#include "utils/Utils.h" -#include "utils/Networking.h" #include "utils/NetworkManager.h" #include "config.h" diff --git a/src/utils/Seed.cpp b/src/utils/Seed.cpp index 852a8dc..9b5cdbd 100644 --- a/src/utils/Seed.cpp +++ b/src/utils/Seed.cpp @@ -1,9 +1,17 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include #include "Seed.h" +#include "constants.h" +#include "monero_seed/monero_seed.hpp" +#include "polyseed/polyseed.h" +#include "utils/AppData.h" + +#include +#include +#include + Seed::Seed(Type type, NetworkType::Type networkType, QString language, const char* secret) : type(type) , networkType(networkType) diff --git a/src/utils/Seed.h b/src/utils/Seed.h index 8302a95..8581ea0 100644 --- a/src/utils/Seed.h +++ b/src/utils/Seed.h @@ -4,17 +4,11 @@ #ifndef FEATHER_SEED_H #define FEATHER_SEED_H -#include "constants.h" -#include "libwalletqt/Wallet.h" -#include "monero_seed/monero_seed.hpp" -#include "polyseed/polyseed.h" -#include "utils/AppData.h" - +#include #include #include -#include -#include +#include "networktype.h" struct Seed { enum Type { diff --git a/src/utils/SemanticVersion.h b/src/utils/SemanticVersion.h index a2fefd8..03f0ede 100644 --- a/src/utils/SemanticVersion.h +++ b/src/utils/SemanticVersion.h @@ -5,6 +5,7 @@ #define FEATHER_SEMANTICVERSION_H #include +#include struct SemanticVersion { diff --git a/src/utils/TorManager.cpp b/src/utils/TorManager.cpp index 3ec1db6..e3b7f52 100644 --- a/src/utils/TorManager.cpp +++ b/src/utils/TorManager.cpp @@ -3,7 +3,8 @@ #include "utils/TorManager.h" -#include +#include +#include #include "utils/config.h" #include "utils/Utils.h" diff --git a/src/utils/TorManager.h b/src/utils/TorManager.h index 2c38ab8..5d0334a 100644 --- a/src/utils/TorManager.h +++ b/src/utils/TorManager.h @@ -4,11 +4,10 @@ #ifndef FEATHER_TOR_H #define FEATHER_TOR_H -#include -#include -#include -#include -#include +#include +#include +#include + #include "utils/SemanticVersion.h" class TorManager : public QObject diff --git a/src/utils/TxFiatHistory.cpp b/src/utils/TxFiatHistory.cpp index ebaf00f..cb9ae34 100644 --- a/src/utils/TxFiatHistory.cpp +++ b/src/utils/TxFiatHistory.cpp @@ -2,6 +2,9 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "TxFiatHistory.h" + +#include + #include "utils/Utils.h" TxFiatHistory::TxFiatHistory(int genesis_timestamp, const QString &configDirectory, QObject *parent) diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index e85f615..ed26b42 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -1,6 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project +#include "Utils.h" + #include #include #include @@ -9,14 +11,20 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include "constants.h" #include "networktype.h" -#include "Utils.h" #include "utils/ColorScheme.h" #include "utils/config.h" #include "utils/os/tails.h" #include "utils/os/whonix.h" +#include "libwalletqt/Wallet.h" #include "WindowManager.h" namespace Utils { diff --git a/src/utils/Utils.h b/src/utils/Utils.h index e9a1fba..ce24b73 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -5,13 +5,16 @@ #define FEATHER_UTILS_H #include -#include #include #include +#include +#include +#include -#include "libwalletqt/Wallet.h" #include "networktype.h" +class SubaddressIndex; + namespace Utils { enum MessageType diff --git a/src/utils/WebsocketClient.cpp b/src/utils/WebsocketClient.cpp index 85b6030..879263e 100644 --- a/src/utils/WebsocketClient.cpp +++ b/src/utils/WebsocketClient.cpp @@ -4,9 +4,12 @@ #include "WebsocketClient.h" #include -#include "utils/Utils.h" +#include +#include +#include #include "utils/config.h" +#include "utils/Utils.h" WebsocketClient::WebsocketClient(QObject *parent) : QObject(parent) diff --git a/src/utils/WebsocketNotifier.cpp b/src/utils/WebsocketNotifier.cpp index b3fbc22..3232f11 100644 --- a/src/utils/WebsocketNotifier.cpp +++ b/src/utils/WebsocketNotifier.cpp @@ -2,8 +2,6 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "WebsocketNotifier.h" -#include "Utils.h" -#include "utils/os/tails.h" #include "utils/os/whonix.h" #include "plugins/PluginRegistry.h" diff --git a/src/utils/config.cpp b/src/utils/config.cpp index 722eb55..a17addf 100644 --- a/src/utils/config.cpp +++ b/src/utils/config.cpp @@ -4,6 +4,10 @@ // SPDX-FileCopyrightText: 2020-2024 The Monero Project #include "config.h" + +#include +#include + #include "utils/Utils.h" #include "utils/os/tails.h" diff --git a/src/utils/daemonrpc.cpp b/src/utils/daemonrpc.cpp index 644ef9a..656db29 100644 --- a/src/utils/daemonrpc.cpp +++ b/src/utils/daemonrpc.cpp @@ -3,6 +3,9 @@ #include "daemonrpc.h" +#include +#include + DaemonRpc::DaemonRpc(QObject *parent, QString daemonAddress) : QObject(parent) , m_network(new Networking(this)) diff --git a/src/utils/daemonrpc.h b/src/utils/daemonrpc.h index fddfce9..d53d098 100644 --- a/src/utils/daemonrpc.h +++ b/src/utils/daemonrpc.h @@ -5,6 +5,7 @@ #define FEATHER_DAEMON_RPC_H #include +#include #include "utils/Networking.h" diff --git a/src/utils/networktype.h b/src/utils/networktype.h index fb5242a..fc7118c 100644 --- a/src/utils/networktype.h +++ b/src/utils/networktype.h @@ -4,7 +4,6 @@ #pragma once #include -#include class NetworkType : public QObject { @@ -12,9 +11,9 @@ class NetworkType : public QObject public: enum Type : uint8_t { - MAINNET = Monero::MAINNET, - TESTNET = Monero::TESTNET, - STAGENET = Monero::STAGENET + MAINNET = 0, + TESTNET = 1, + STAGENET = 2 }; Q_ENUM(Type) }; diff --git a/src/utils/nodes.cpp b/src/utils/nodes.cpp index a31acc2..e8550dd 100644 --- a/src/utils/nodes.cpp +++ b/src/utils/nodes.cpp @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include - #include "nodes.h" + +#include "libwalletqt/Wallet.h" #include "utils/AppData.h" #include "utils/Utils.h" #include "utils/os/tails.h" diff --git a/src/utils/nodes.h b/src/utils/nodes.h index 920fda9..77bca0d 100644 --- a/src/utils/nodes.h +++ b/src/utils/nodes.h @@ -4,14 +4,19 @@ #ifndef FEATHER_NODES_H #define FEATHER_NODES_H +#include +#include #include #include #include +#include #include "model/NodeModel.h" #include "utils/Utils.h" #include "utils/config.h" +class Wallet; + enum NodeSource { websocket = 0, custom diff --git a/src/utils/os/tails.cpp b/src/utils/os/tails.cpp index 73d5603..1cbe937 100644 --- a/src/utils/os/tails.cpp +++ b/src/utils/os/tails.cpp @@ -1,10 +1,12 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project +#include "tails.h" + +#include #include #include -#include "tails.h" #include "Utils.h" bool TailsOS::detected = false; diff --git a/src/utils/os/tails.h b/src/utils/os/tails.h index 49c6ad9..d30e1dc 100644 --- a/src/utils/os/tails.h +++ b/src/utils/os/tails.h @@ -4,6 +4,8 @@ #ifndef TAILSOS_H #define TAILSOS_H +#include + class TailsOS { public: diff --git a/src/utils/prices.cpp b/src/utils/prices.cpp index 5eb2dfe..1ee9c20 100644 --- a/src/utils/prices.cpp +++ b/src/utils/prices.cpp @@ -1,7 +1,10 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include "utils/prices.h" +#include "prices.h" + +#include +#include Prices::Prices(QObject *parent) : QObject(parent) diff --git a/src/utils/scheduler.h b/src/utils/scheduler.h index 996923c..2be4411 100644 --- a/src/utils/scheduler.h +++ b/src/utils/scheduler.h @@ -4,13 +4,9 @@ #ifndef FUTURE_SCHEDULER_H #define FUTURE_SCHEDULER_H -#include - #include #include -//#include #include -#include #include #include diff --git a/src/utils/updater/Updater.cpp b/src/utils/updater/Updater.cpp index 708a3c5..b448e89 100644 --- a/src/utils/updater/Updater.cpp +++ b/src/utils/updater/Updater.cpp @@ -12,7 +12,6 @@ #include "Utils.h" #include "utils/AsyncTask.h" #include "utils/Networking.h" -#include "utils/NetworkManager.h" #include "utils/SemanticVersion.h" Updater::Updater(QObject *parent) : diff --git a/src/widgets/UrlListConfigureWidget.h b/src/widgets/UrlListConfigureWidget.h index b84bd54..4642cfc 100644 --- a/src/widgets/UrlListConfigureWidget.h +++ b/src/widgets/UrlListConfigureWidget.h @@ -5,7 +5,6 @@ #define FEATHER_URLLISTCONFIGUREWIDGET_H #include -#include #include "utils/config.h" diff --git a/src/widgets/WalletUnlockWidget.cpp b/src/widgets/WalletUnlockWidget.cpp index 3e6e140..e4e1f43 100644 --- a/src/widgets/WalletUnlockWidget.cpp +++ b/src/widgets/WalletUnlockWidget.cpp @@ -8,6 +8,7 @@ #include #include "utils/Utils.h" +#include "libwalletqt/Wallet.h" WalletUnlockWidget::WalletUnlockWidget(QWidget *parent, Wallet *wallet) : QWidget(parent) diff --git a/src/widgets/WalletUnlockWidget.h b/src/widgets/WalletUnlockWidget.h index dfbaabe..d6efa8d 100644 --- a/src/widgets/WalletUnlockWidget.h +++ b/src/widgets/WalletUnlockWidget.h @@ -5,9 +5,8 @@ #define FEATHER_WALLETUNLOCKWIDGET_H #include -#include -#include "Wallet.h" +class Wallet; namespace Ui { class WalletUnlockWidget; diff --git a/src/wizard/PageHardwareDevice.cpp b/src/wizard/PageHardwareDevice.cpp index b1c749c..3c444fb 100644 --- a/src/wizard/PageHardwareDevice.cpp +++ b/src/wizard/PageHardwareDevice.cpp @@ -3,12 +3,13 @@ #include "PageHardwareDevice.h" #include "ui_PageHardwareDevice.h" -#include "WalletWizard.h" #include #include #include +#include "WalletWizard.h" + PageHardwareDevice::PageHardwareDevice(WizardFields *fields, QWidget *parent) : QWizardPage(parent) , ui(new Ui::PageHardwareDevice) diff --git a/src/wizard/PageHardwareDevice.h b/src/wizard/PageHardwareDevice.h index aa5d703..0100b1e 100644 --- a/src/wizard/PageHardwareDevice.h +++ b/src/wizard/PageHardwareDevice.h @@ -4,12 +4,9 @@ #ifndef FEATHER_PAGEHARDWAREDEVICE_H #define FEATHER_PAGEHARDWAREDEVICE_H -#include #include -#include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageHardwareDevice; diff --git a/src/wizard/PageMenu.cpp b/src/wizard/PageMenu.cpp index ac33769..e318c06 100644 --- a/src/wizard/PageMenu.cpp +++ b/src/wizard/PageMenu.cpp @@ -1,13 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include "WalletWizard.h" #include "PageMenu.h" #include "ui_PageMenu.h" -#include - #include "config-feather.h" +#include "WalletWizard.h" PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent) : QWizardPage(parent) diff --git a/src/wizard/PageMenu.h b/src/wizard/PageMenu.h index de18e06..0c3db97 100644 --- a/src/wizard/PageMenu.h +++ b/src/wizard/PageMenu.h @@ -4,9 +4,10 @@ #ifndef FEATHER_WIZARDMENU_H #define FEATHER_WIZARDMENU_H -#include #include -#include + +class WizardFields; +class WalletKeysFilesModel; namespace Ui { class PageMenu; diff --git a/src/wizard/PageNetwork.cpp b/src/wizard/PageNetwork.cpp index 3f57c0a..08da1e1 100644 --- a/src/wizard/PageNetwork.cpp +++ b/src/wizard/PageNetwork.cpp @@ -7,6 +7,7 @@ #include #include "constants.h" +#include "utils/nodes.h" #include "utils/os/Prestium.h" #include "Utils.h" #include "WalletWizard.h" diff --git a/src/wizard/PageNetwork.h b/src/wizard/PageNetwork.h index e59b437..6a55ac5 100644 --- a/src/wizard/PageNetwork.h +++ b/src/wizard/PageNetwork.h @@ -4,11 +4,8 @@ #ifndef FEATHER_WIZARDNETWORK_H #define FEATHER_WIZARDNETWORK_H -#include #include -#include - -#include "utils/nodes.h" +#include namespace Ui { class PageNetwork; diff --git a/src/wizard/PageNetworkProxy.cpp b/src/wizard/PageNetworkProxy.cpp index 7f6e8c0..10e1d6d 100644 --- a/src/wizard/PageNetworkProxy.cpp +++ b/src/wizard/PageNetworkProxy.cpp @@ -3,9 +3,10 @@ #include "PageNetworkProxy.h" #include "ui_PageNetworkProxy.h" -#include "WalletWizard.h" -#include +#include + +#include "WalletWizard.h" PageNetworkProxy::PageNetworkProxy(QWidget *parent) : QWizardPage(parent) diff --git a/src/wizard/PageOpenWallet.cpp b/src/wizard/PageOpenWallet.cpp index a290698..bb76227 100644 --- a/src/wizard/PageOpenWallet.cpp +++ b/src/wizard/PageOpenWallet.cpp @@ -8,6 +8,7 @@ #include "constants.h" #include "WalletWizard.h" +#include "model/WalletKeysFilesModel.h" PageOpenWallet::PageOpenWallet(WalletKeysFilesModel *wallets, QWidget *parent) : QWizardPage(parent) diff --git a/src/wizard/PageOpenWallet.h b/src/wizard/PageOpenWallet.h index 6c4ad1b..3db31f2 100644 --- a/src/wizard/PageOpenWallet.h +++ b/src/wizard/PageOpenWallet.h @@ -7,9 +7,9 @@ #include #include #include -#include -#include "model/WalletKeysFilesModel.h" +class WalletKeysFilesModel; +class WalletKeysFilesProxyModel; namespace Ui { class PageOpenWallet; diff --git a/src/wizard/PageSetPassword.h b/src/wizard/PageSetPassword.h index 6c276be..d3d9a87 100644 --- a/src/wizard/PageSetPassword.h +++ b/src/wizard/PageSetPassword.h @@ -5,9 +5,8 @@ #define FEATHER_PASSWORD_H #include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageSetPassword; diff --git a/src/wizard/PageSetRestoreHeight.cpp b/src/wizard/PageSetRestoreHeight.cpp index 10ac6b9..a2d279c 100644 --- a/src/wizard/PageSetRestoreHeight.cpp +++ b/src/wizard/PageSetRestoreHeight.cpp @@ -1,13 +1,15 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include #include "PageSetRestoreHeight.h" #include "ui_PageSetRestoreHeight.h" -#include "WalletWizard.h" -#include "constants.h" +#include + +#include "constants.h" +#include "utils/AppData.h" #include "utils/Icons.h" +#include "WalletWizard.h" PageSetRestoreHeight::PageSetRestoreHeight(WizardFields *fields, QWidget *parent) : QWizardPage(parent) diff --git a/src/wizard/PageSetRestoreHeight.h b/src/wizard/PageSetRestoreHeight.h index 449fdc5..0335cec 100644 --- a/src/wizard/PageSetRestoreHeight.h +++ b/src/wizard/PageSetRestoreHeight.h @@ -5,9 +5,8 @@ #define FEATHER_PAGESETRESTOREHEIGHT_H #include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageSetRestoreHeight; diff --git a/src/wizard/PageSetSeedPassphrase.h b/src/wizard/PageSetSeedPassphrase.h index 25a7e92..821507f 100644 --- a/src/wizard/PageSetSeedPassphrase.h +++ b/src/wizard/PageSetSeedPassphrase.h @@ -5,9 +5,8 @@ #define FEATHER_PAGESETSEEDPASSPHRASE_H #include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageSetSeedPassphrase; diff --git a/src/wizard/PageSetSubaddressLookahead.h b/src/wizard/PageSetSubaddressLookahead.h index fc7a6d3..64860c0 100644 --- a/src/wizard/PageSetSubaddressLookahead.h +++ b/src/wizard/PageSetSubaddressLookahead.h @@ -5,9 +5,8 @@ #define FEATHER_PAGESETSUBADDRESSLOOKAHEAD_H #include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageSetSubaddressLookahead; diff --git a/src/wizard/PageWalletFile.h b/src/wizard/PageWalletFile.h index 32e5159..d822637 100644 --- a/src/wizard/PageWalletFile.h +++ b/src/wizard/PageWalletFile.h @@ -4,10 +4,9 @@ #ifndef FEATHER_CREATEWALLET_H #define FEATHER_CREATEWALLET_H -#include #include -#include -#include + +class WizardFields; namespace Ui { class PageWalletFile; diff --git a/src/wizard/PageWalletRestoreKeys.h b/src/wizard/PageWalletRestoreKeys.h index 6eafe34..90f5b46 100644 --- a/src/wizard/PageWalletRestoreKeys.h +++ b/src/wizard/PageWalletRestoreKeys.h @@ -4,13 +4,9 @@ #ifndef FEATHER_WIZARDVIEWONLY_H #define FEATHER_WIZARDVIEWONLY_H -#include #include -#include -#include -#include -#include "WalletWizard.h" +class WizardFields; namespace Ui { class PageWalletRestoreKeys; diff --git a/src/wizard/PageWalletRestoreSeed.cpp b/src/wizard/PageWalletRestoreSeed.cpp index e8a2c0f..624efdb 100644 --- a/src/wizard/PageWalletRestoreSeed.cpp +++ b/src/wizard/PageWalletRestoreSeed.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include diff --git a/src/wizard/PageWalletRestoreSeed.h b/src/wizard/PageWalletRestoreSeed.h index e2fdee0..2c3bc83 100644 --- a/src/wizard/PageWalletRestoreSeed.h +++ b/src/wizard/PageWalletRestoreSeed.h @@ -4,13 +4,9 @@ #ifndef FEATHER_WIZARDRESTORE_H #define FEATHER_WIZARDRESTORE_H -#include #include -#include -#include #include - -#include "utils/textedit.h" +#include namespace Ui { class PageWalletRestoreSeed; diff --git a/src/wizard/PageWalletSeed.cpp b/src/wizard/PageWalletSeed.cpp index 165d7c1..82f7457 100644 --- a/src/wizard/PageWalletSeed.cpp +++ b/src/wizard/PageWalletSeed.cpp @@ -1,7 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include "WalletWizard.h" #include "PageWalletSeed.h" #include "ui_PageWalletSeed.h" @@ -10,7 +9,9 @@ #include #include #include +#include +#include "WalletWizard.h" #include "constants.h" #include "Seed.h" #include "Icons.h" diff --git a/src/wizard/PageWalletSeed.h b/src/wizard/PageWalletSeed.h index a06d013..474d95e 100644 --- a/src/wizard/PageWalletSeed.h +++ b/src/wizard/PageWalletSeed.h @@ -4,11 +4,11 @@ #ifndef FEATHER_CREATEWALLETSEED_H #define FEATHER_CREATEWALLETSEED_H -#include #include -#include -#include "utils/Utils.h" +#include "utils/Seed.h" + +class WizardFields; namespace Ui { class PageWalletSeed; diff --git a/src/wizard/WalletWizard.cpp b/src/wizard/WalletWizard.cpp index e60bfa8..760f9e9 100644 --- a/src/wizard/WalletWizard.cpp +++ b/src/wizard/WalletWizard.cpp @@ -1,9 +1,10 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2024 The Monero Project -#include "utils/Utils.h" - #include "WalletWizard.h" + +#include + #include "PageMenu.h" #include "PageOpenWallet.h" #include "PagePlugins.h" @@ -21,10 +22,7 @@ #include "PageNetworkWebsocket.h" #include "constants.h" #include "WindowManager.h" - -#include -#include -#include +#include "utils/AppData.h" WalletWizard::WalletWizard(QWidget *parent) : QWizard(parent) diff --git a/src/wizard/WalletWizard.h b/src/wizard/WalletWizard.h index 92cd77d..1cc705c 100644 --- a/src/wizard/WalletWizard.h +++ b/src/wizard/WalletWizard.h @@ -5,8 +5,6 @@ #define FEATHER_WALLETWIZARD_H #include -#include -#include #include "model/WalletKeysFilesModel.h" #include "utils/RestoreHeightLookup.h" diff --git a/src/wizard/offline_tx_signing/OfflineTxSigningWizard.h b/src/wizard/offline_tx_signing/OfflineTxSigningWizard.h index 38bad01..50e59d6 100644 --- a/src/wizard/offline_tx_signing/OfflineTxSigningWizard.h +++ b/src/wizard/offline_tx_signing/OfflineTxSigningWizard.h @@ -5,9 +5,9 @@ #define FEATHER_OFFLINETXSIGNINGWIZARD_H #include -#include "Wallet.h" - #include + +#include "Wallet.h" #include "qrcode/scanner/QrCodeScanWidget.h" struct TxWizardFields { diff --git a/src/wizard/offline_tx_signing/PageOTS_Import.h b/src/wizard/offline_tx_signing/PageOTS_Import.h index 69351da..62b6279 100644 --- a/src/wizard/offline_tx_signing/PageOTS_Import.h +++ b/src/wizard/offline_tx_signing/PageOTS_Import.h @@ -22,7 +22,6 @@ public: void initializePage() override; bool validatePage() override; bool isComplete() const override; - bool openFile(std::string &data); private slots: void onScanFinished(bool success); diff --git a/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.cpp b/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.cpp index f76ef73..fdcc685 100644 --- a/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.cpp +++ b/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.cpp @@ -6,7 +6,6 @@ #include "OfflineTxSigningWizard.h" #include -#include #include "utils/config.h" #include "utils/Icons.h" diff --git a/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.h b/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.h index 8fe312d..cb22bdf 100644 --- a/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.h +++ b/src/wizard/offline_tx_signing/PageOTS_ImportKeyImages.h @@ -26,7 +26,6 @@ private slots: void importFromStr(const std::string &data) override; private: - void onSuccess(); bool proceed(); }; diff --git a/src/wizard/offline_tx_signing/PageOTS_ImportOffline.cpp b/src/wizard/offline_tx_signing/PageOTS_ImportOffline.cpp index 3ee389b..68f8349 100644 --- a/src/wizard/offline_tx_signing/PageOTS_ImportOffline.cpp +++ b/src/wizard/offline_tx_signing/PageOTS_ImportOffline.cpp @@ -8,7 +8,6 @@ #include #include "dialog/TxConfAdvDialog.h" -#include "utils/config.h" #include "utils/Icons.h" #include "utils/Utils.h" diff --git a/src/wizard/offline_tx_signing/PageOTS_ImportSignedTx.cpp b/src/wizard/offline_tx_signing/PageOTS_ImportSignedTx.cpp index df5b907..f4e99bd 100644 --- a/src/wizard/offline_tx_signing/PageOTS_ImportSignedTx.cpp +++ b/src/wizard/offline_tx_signing/PageOTS_ImportSignedTx.cpp @@ -9,7 +9,6 @@ #include "dialog/TxConfDialog.h" #include "dialog/TxConfAdvDialog.h" -#include "utils/config.h" #include "utils/Icons.h" #include "utils/Utils.h" From 8e31b2b5eeb27c99813748c1d6d5c925f0735132 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 1 Oct 2024 23:09:39 +0200 Subject: [PATCH 37/76] cmake: cleanup linking --- CMakeLists.txt | 34 +---- cmake/FindSodium.cmake | 291 ----------------------------------------- monero | 2 +- src/CMakeLists.txt | 5 +- 4 files changed, 4 insertions(+), 328 deletions(-) delete mode 100644 cmake/FindSodium.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 86538c7..6c5b1b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,9 +72,7 @@ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/monero/CMakeLists.txt") message(FATAL_ERROR "'monero/CMakeLists.txt' does not exist, did you forget to:\ngit submodule update --init --recursive --progress") endif() add_subdirectory(monero EXCLUDE_FROM_ALL) -set_property(TARGET wallet_merged PROPERTY FOLDER "monero") get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH) -get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIBRARY) get_directory_property(DEVICE_TREZOR_READY DIRECTORY "monero" DEFINITION DEVICE_TREZOR_READY) get_directory_property(TREZOR_DEP_LIBS DIRECTORY "monero" DEFINITION TREZOR_DEP_LIBS) get_directory_property(OPENBSD DIRECTORY "monero" DEFINITION OPENBSD) @@ -91,10 +89,6 @@ endif() # pthread find_package(Threads REQUIRED) -# Sodium -find_library(SODIUM_LIBRARY sodium) -message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}") - # QrEncode find_package(QREncode REQUIRED) @@ -136,29 +130,12 @@ if(MINGW) set(MINGW_FLAG "${MINGW_FLAG} -DWIN32_LEAN_AND_MEAN") set(Boost_THREADAPI win32) endif() - -set(BOOST_COMPONENTS - chrono - date_time - filesystem - program_options - regex - serialization - system - thread -) -if (WIN32) - list(APPEND BOOST_COMPONENTS locale) -endif() +set(Boost_USE_MULTITHREADED ON) if(STACK_TRACE AND UNIX AND NOT APPLE) - list(APPEND BOOST_COMPONENTS - stacktrace_basic) + find_package(Boost 1.58 REQUIRED COMPONENTS stacktrace_basic) endif() -set(Boost_USE_MULTITHREADED ON) -find_package(Boost 1.58 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) - if(UNIX AND NOT APPLE) if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # https://github.com/monero-project/monero-gui/issues/3142#issuecomment-705940446 @@ -252,13 +229,6 @@ if (NOT WIN32 AND NOT OPENBSD AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS) endif() -# -mmitigate-rop -# removed in GCC 9.1 (or before ?), but still accepted, so spams the output -if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)) - add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS) -endif() - # linker if (APPLE) add_linker_flag_if_supported(-Wl,-bind_at_load LD_SECURITY_FLAGS) diff --git a/cmake/FindSodium.cmake b/cmake/FindSodium.cmake deleted file mode 100644 index 3792815..0000000 --- a/cmake/FindSodium.cmake +++ /dev/null @@ -1,291 +0,0 @@ -# Written in 2016 by Henrik Steffen Gaßmann -# -# To the extent possible under law, the author(s) have dedicated all copyright -# and related and neighboring rights to this software to the public domain -# worldwide. This software is distributed without any warranty. -# -# You should have received a copy of the CC0 Public Domain Dedication along with -# this software. If not, see -# -# http://creativecommons.org/publicdomain/zero/1.0/ -# -# ############################################################################## -# Tries to find the local libsodium installation. -# -# On Windows the sodium_DIR environment variable is used as a default hint which -# can be overridden by setting the corresponding cmake variable. -# -# Once done the following variables will be defined: -# -# sodium_FOUND sodium_INCLUDE_DIR sodium_LIBRARY_DEBUG sodium_LIBRARY_RELEASE -# sodium_VERSION_STRING -# -# Furthermore an imported "sodium" target is created. -# - -if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") - set(_GCC_COMPATIBLE 1) -endif() - -# static library option -if(NOT DEFINED sodium_USE_STATIC_LIBS) - option(sodium_USE_STATIC_LIBS "enable to statically link against sodium" OFF) -endif() -if(NOT (sodium_USE_STATIC_LIBS EQUAL sodium_USE_STATIC_LIBS_LAST)) - unset(sodium_LIBRARY CACHE) - unset(sodium_LIBRARY_DEBUG CACHE) - unset(sodium_LIBRARY_RELEASE CACHE) - unset(sodium_DLL_DEBUG CACHE) - unset(sodium_DLL_RELEASE CACHE) - set(sodium_USE_STATIC_LIBS_LAST - ${sodium_USE_STATIC_LIBS} - CACHE INTERNAL "internal change tracking variable") -endif() - -# ############################################################################## -# UNIX -if(UNIX) - # import pkg-config - find_package(PkgConfig QUIET) - if(PKG_CONFIG_FOUND) - pkg_check_modules(sodium_PKG QUIET libsodium) - endif() - - if(sodium_USE_STATIC_LIBS) - if(sodium_PKG_STATIC_LIBRARIES) - foreach(_libname ${sodium_PKG_STATIC_LIBRARIES}) - if(NOT _libname MATCHES "^lib.*\\.a$") # ignore strings already ending - # with .a - list(INSERT sodium_PKG_STATIC_LIBRARIES 0 "lib${_libname}.a") - endif() - endforeach() - list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES) - else() - # if pkgconfig for libsodium doesn't provide static lib info, then - # override PKG_STATIC here.. - set(sodium_PKG_STATIC_LIBRARIES libsodium.a) - endif() - - set(XPREFIX sodium_PKG_STATIC) - else() - if(sodium_PKG_LIBRARIES STREQUAL "") - set(sodium_PKG_LIBRARIES sodium) - endif() - - set(XPREFIX sodium_PKG) - endif() - - find_path(sodium_INCLUDE_DIR sodium.h HINTS ${${XPREFIX}_INCLUDE_DIRS}) - find_library(sodium_LIBRARY_DEBUG - NAMES ${${XPREFIX}_LIBRARIES} - HINTS ${${XPREFIX}_LIBRARY_DIRS}) - find_library(sodium_LIBRARY_RELEASE - NAMES ${${XPREFIX}_LIBRARIES} - HINTS ${${XPREFIX}_LIBRARY_DIRS}) - - # ############################################################################ - # Windows -elseif(WIN32) - set(sodium_DIR "$ENV{sodium_DIR}" CACHE FILEPATH "sodium install directory") - mark_as_advanced(sodium_DIR) - - find_path(sodium_INCLUDE_DIR sodium.h - HINTS ${sodium_DIR} - PATH_SUFFIXES include) - - if(MSVC) - # detect target architecture - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/arch.c" [=[ - #if defined _M_IX86 - #error ARCH_VALUE x86_32 - #elif defined _M_X64 - #error ARCH_VALUE x86_64 - #endif - #error ARCH_VALUE unknown - ]=]) - try_compile(_UNUSED_VAR "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_CURRENT_BINARY_DIR}/arch.c" - OUTPUT_VARIABLE _COMPILATION_LOG) - string(REGEX - REPLACE ".*ARCH_VALUE ([a-zA-Z0-9_]+).*" - "\\1" - _TARGET_ARCH - "${_COMPILATION_LOG}") - - # construct library path - if(_TARGET_ARCH STREQUAL "x86_32") - string(APPEND _PLATFORM_PATH "Win32") - elseif(_TARGET_ARCH STREQUAL "x86_64") - string(APPEND _PLATFORM_PATH "x64") - else() - message( - FATAL_ERROR - "the ${_TARGET_ARCH} architecture is not supported by Findsodium.cmake." - ) - endif() - string(APPEND _PLATFORM_PATH "/$$CONFIG$$") - - if(MSVC_VERSION LESS 1900) - math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60") - else() - math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50") - endif() - string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}") - - if(sodium_USE_STATIC_LIBS) - string(APPEND _PLATFORM_PATH "/static") - else() - string(APPEND _PLATFORM_PATH "/dynamic") - endif() - - string(REPLACE "$$CONFIG$$" - "Debug" - _DEBUG_PATH_SUFFIX - "${_PLATFORM_PATH}") - string(REPLACE "$$CONFIG$$" - "Release" - _RELEASE_PATH_SUFFIX - "${_PLATFORM_PATH}") - - find_library(sodium_LIBRARY_DEBUG libsodium.lib - HINTS ${sodium_DIR} - PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}) - find_library(sodium_LIBRARY_RELEASE libsodium.lib - HINTS ${sodium_DIR} - PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}) - if(NOT sodium_USE_STATIC_LIBS) - set(CMAKE_FIND_LIBRARY_SUFFIXES_BCK ${CMAKE_FIND_LIBRARY_SUFFIXES}) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") - find_library(sodium_DLL_DEBUG libsodium - HINTS ${sodium_DIR} - PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}) - find_library(sodium_DLL_RELEASE libsodium - HINTS ${sodium_DIR} - PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BCK}) - endif() - - elseif(_GCC_COMPATIBLE) - if(sodium_USE_STATIC_LIBS) - find_library(sodium_LIBRARY_DEBUG libsodium.a - HINTS ${sodium_DIR} - PATH_SUFFIXES lib) - find_library(sodium_LIBRARY_RELEASE libsodium.a - HINTS ${sodium_DIR} - PATH_SUFFIXES lib) - else() - find_library(sodium_LIBRARY_DEBUG libsodium.dll.a - HINTS ${sodium_DIR} - PATH_SUFFIXES lib) - find_library(sodium_LIBRARY_RELEASE libsodium.dll.a - HINTS ${sodium_DIR} - PATH_SUFFIXES lib) - - file(GLOB _DLL - LIST_DIRECTORIES false - RELATIVE "${sodium_DIR}/bin" - "${sodium_DIR}/bin/libsodium*.dll") - find_library(sodium_DLL_DEBUG ${_DLL} libsodium - HINTS ${sodium_DIR} - PATH_SUFFIXES bin) - find_library(sodium_DLL_RELEASE ${_DLL} libsodium - HINTS ${sodium_DIR} - PATH_SUFFIXES bin) - endif() - else() - message(FATAL_ERROR "this platform is not supported by FindSodium.cmake") - endif() - - # ############################################################################ - # unsupported -else() - message(FATAL_ERROR "this platform is not supported by FindSodium.cmake") -endif() - -# ############################################################################## -# common stuff - -# extract sodium version -if(sodium_INCLUDE_DIR) - set(_VERSION_HEADER "${sodium_INCLUDE_DIR}/sodium/version.h") - if(EXISTS "${_VERSION_HEADER}") - file(READ "${_VERSION_HEADER}" _VERSION_HEADER_CONTENT) - string(REGEX - REPLACE ".*define[ \t]+SODIUM_VERSION_STRING[^\"]+\"([^\"]+)\".*" - "\\1" - sodium_VERSION_STRING - "${_VERSION_HEADER_CONTENT}") - set(sodium_VERSION_STRING "${sodium_VERSION_STRING}") - endif() -endif() - -# communicate results -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(sodium - REQUIRED_VARS - sodium_LIBRARY_RELEASE - sodium_LIBRARY_DEBUG - sodium_INCLUDE_DIR - VERSION_VAR - sodium_VERSION_STRING) - -# mark file paths as advanced -mark_as_advanced(sodium_INCLUDE_DIR) -mark_as_advanced(sodium_LIBRARY_DEBUG) -mark_as_advanced(sodium_LIBRARY_RELEASE) -if(WIN32) - mark_as_advanced(sodium_DLL_DEBUG) - mark_as_advanced(sodium_DLL_RELEASE) -endif() - -# create imported target -if(sodium_USE_STATIC_LIBS) - set(_LIB_TYPE STATIC) -else() - set(_LIB_TYPE SHARED) -endif() -add_library(sodium ${_LIB_TYPE} IMPORTED) - -set_target_properties(sodium - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${sodium_INCLUDE_DIR}" - IMPORTED_LINK_INTERFACE_LANGUAGES - "C") - -if(sodium_USE_STATIC_LIBS) - set_target_properties(sodium - PROPERTIES INTERFACE_COMPILE_DEFINITIONS - "SODIUM_STATIC" - IMPORTED_LOCATION - "${sodium_LIBRARY_RELEASE}" - IMPORTED_LOCATION_DEBUG - "${sodium_LIBRARY_DEBUG}") -else() - if(UNIX) - set_target_properties(sodium - PROPERTIES IMPORTED_LOCATION - "${sodium_LIBRARY_RELEASE}" - IMPORTED_LOCATION_DEBUG - "${sodium_LIBRARY_DEBUG}") - elseif(WIN32) - set_target_properties(sodium - PROPERTIES IMPORTED_IMPLIB - "${sodium_LIBRARY_RELEASE}" - IMPORTED_IMPLIB_DEBUG - "${sodium_LIBRARY_DEBUG}") - if(NOT (sodium_DLL_DEBUG MATCHES ".*-NOTFOUND")) - set_target_properties(sodium - PROPERTIES IMPORTED_LOCATION_DEBUG - "${sodium_DLL_DEBUG}") - endif() - if(NOT (sodium_DLL_RELEASE MATCHES ".*-NOTFOUND")) - set_target_properties(sodium - PROPERTIES IMPORTED_LOCATION_RELWITHDEBINFO - "${sodium_DLL_RELEASE}" - IMPORTED_LOCATION_MINSIZEREL - "${sodium_DLL_RELEASE}" - IMPORTED_LOCATION_RELEASE - "${sodium_DLL_RELEASE}") - endif() - endif() -endif() \ No newline at end of file diff --git a/monero b/monero index 5b9a197..16e051c 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit 5b9a197de481409ab3dc4cd25c5a1048d20ca09f +Subproject commit 16e051c8a880a63aacdd217f24c55f9f6154bb00 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9100de9..8ca40be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -249,11 +249,8 @@ if (DEPENDS) endif() target_link_libraries(feather PRIVATE - wallet_merged - ${LMDB_LIBRARY} + wallet_api epee - ${UNBOUND_LIBRARY} - ${SODIUM_LIBRARY} easylogging ringct ${Boost_LIBRARIES} From 8deae7398db0e5ea177f3950f4c07f355e554015 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 2 Oct 2024 00:06:10 +0200 Subject: [PATCH 38/76] build: fix WITH_SCANNER=OFF --- src/SendWidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/SendWidget.cpp b/src/SendWidget.cpp index a00c2cf..418e2b8 100644 --- a/src/SendWidget.cpp +++ b/src/SendWidget.cpp @@ -4,13 +4,12 @@ #include "SendWidget.h" #include "ui_SendWidget.h" -#include - #include "ColorScheme.h" #include "constants.h" #include "utils/AppData.h" #include "utils/config.h" #include "Icons.h" +#include "libwalletqt/Wallet.h" #include "libwalletqt/WalletManager.h" #if defined(WITH_SCANNER) @@ -29,8 +28,7 @@ SendWidget::SendWidget(Wallet *wallet, QWidget *parent) QString amount_rx = R"(^\d{0,8}[\.,]\d{0,12}|(all)$)"; QRegularExpression rx; rx.setPattern(amount_rx); - QValidator *validator = new QRegularExpressionValidator(rx, this); - ui->lineAmount->setValidator(validator); + ui->lineAmount->setValidator(new QRegularExpressionValidator(rx, this)); connect(m_wallet, &Wallet::initiateTransaction, this, &SendWidget::disableSendButton); connect(m_wallet, &Wallet::transactionCreated, this, &SendWidget::enableSendButton); From 39434708d6b4eba4444d74717978a5b00e4f8018 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 01:02:39 +0200 Subject: [PATCH 39/76] remove more unused includes --- src/SettingsDialog.cpp | 2 -- src/dialog/LegacySeedRecovery.cpp | 2 -- src/dialog/URSettingsDialog.cpp | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 2f52a8a..3ad8c75 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -15,8 +15,6 @@ #include "utils/nodes.h" #include "utils/WebsocketNotifier.h" #include "widgets/NetworkProxyWidget.h" -#include "WindowManager.h" -#include "plugins/PluginRegistry.h" #include "utils/ColorScheme.h" Settings::Settings(Nodes *nodes, QWidget *parent) diff --git a/src/dialog/LegacySeedRecovery.cpp b/src/dialog/LegacySeedRecovery.cpp index 94a9d22..7b27b44 100644 --- a/src/dialog/LegacySeedRecovery.cpp +++ b/src/dialog/LegacySeedRecovery.cpp @@ -8,10 +8,8 @@ #include "ColorScheme.h" #include "utils/Utils.h" #include "polyseed/polyseed.h" -#include "utils/AsyncTask.h" #include "device/device_default.hpp" #include "cryptonote_basic/account.h" -#include "cryptonote_basic/cryptonote_basic_impl.h" #include "cryptonote_basic/blobdatatype.h" #include "common/base58.h" #include "serialization/binary_utils.h" diff --git a/src/dialog/URSettingsDialog.cpp b/src/dialog/URSettingsDialog.cpp index 8ac5b42..febd57d 100644 --- a/src/dialog/URSettingsDialog.cpp +++ b/src/dialog/URSettingsDialog.cpp @@ -4,8 +4,6 @@ #include "URSettingsDialog.h" #include "ui_URSettingsDialog.h" -#include - #include "utils/config.h" #include "utils/Utils.h" From bd0d1cfe7607a99b7ceb6dc478ad5f28547ed709 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 15:22:00 +0200 Subject: [PATCH 40/76] update README.md --- README.md | 67 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index ae61853..f60e740 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,63 @@ # Feather Wallet -Feather is a free, open-source Monero wallet for Linux, Tails, macOS and Windows. It is written in C++ with the Qt framework. +Feather is a free Monero desktop wallet for Linux, Tails, macOS and Windows. It is written in C++ with the Qt framework. -Copyright (c) 2020-2024, The Monero Project. +- **easy-to-use**, **small** and **fast** - Feather runs well on any modern hardware, including virtual machines and live operating systems. +- **beginner friendly**, but also caters to advanced Monero users by providing a [feature set](https://docs.featherwallet.org/guides/features) that is on par with the official CLI. +- ships with **sane defaults** that suit most users, but can also be configured for high or uncommon threat models. +- serves as a testing grounds for **experimental features** that may later be adopted in the reference wallets. + +## Download + +You can download Feather from **[featherwallet.org](https://featherwallet.org/download/)** or **[GitHub](https://github.com/feather-wallet/feather/releases)**. + +If you need help installing installing Feather, check the [installation documentation](https://docs.featherwallet.org/). + +Releases are signed with our [release signing key](https://docs.featherwallet.org/guides/release-signing-key). +We recommend that you verify downloads with GPG. ## Resources -* Web: [featherwallet.org](https://featherwallet.org) -* Docs: [docs.featherwallet.org](https://docs.featherwallet.org) -* Git: [github.com/feather-wallet/feather](https://github.com/feather-wallet/feather) -* Reddit: [/r/FeatherWallet](https://old.reddit.com/r/FeatherWallet) -* Lemmy: [monero.town/c/featherwallet](https://monero.town/c/featherwallet) -* Mail: dev@featherwallet.org +* [Official Site](https://featherwallet.org) +* [Documentation](https://docs.featherwallet.org) +* [Git Repository](https://github.com/feather-wallet/feather) +* [Matrix](https://matrix.to/#/#feather:monero.social) * IRC: `#feather` on [OFTC](https://www.oftc.net/) -* Matrix: [matrix.to/#/#feather:monero.social](https://matrix.to/#/#feather:monero.social) +* Mail: dev@featherwallet.org -**Download** the latest release [here](https://featherwallet.org/download). +If you need help with your wallet, please contact us via Matrix or IRC. +If you don't have an IRC client, you can join the room via [webchat](https://webchat.oftc.net/?randomnick=1&channels=feather). +If you don’t receive a response immediately please idle in the room. -## Supporting the project +## Release Builds -Feather is a 100% community-sponsored project. If you want to join our efforts, the easiest thing you can do is support the project financially. +To learn how to run a bootstrappable release build, see: [contrib/guix/README.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md) -Donations help pay for hosting, build servers, domain names, e-mail and other recurring costs. Any amount helps. +For release attestations, see: http://github.com/feather-wallet/feather-sigs -`47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f` - -## Deterministic builds - -See [contrib/guix/README.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md) for more information. +For release policy, see: [RELEASE.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/RELEASE.md) ## Development If you are looking to set up a development environment for Feather, see [HACKING.md](https://github.com/feather-wallet/feather/blob/master/HACKING.md). -It is highly recommended that you join the `#feather` IRC channel on [OFTC](https://www.oftc.net/) or [`#feather:monero.social`](https://matrix.to/#/#feather:monero.social) on Matrix if you -are hacking on Feather. Due to the nature of this open source software project, idling in this channel is the best -way to stay updated on best practices and new developments. +It is highly recommended that you join our Matrix or IRC channel if you are hacking on Feather. +Idling in this channel is the best way to stay updated on best practices and new developments. + +For information on how Feather is maintained, see: [MAINTENANCE.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/MAINTENANCE.md) + +To report a security vulnerability, see: [SECURITY.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/RELEASE.md) + +## Support + +Feather is funded entirely through donations. We don't take a cut from transaction fees and make no money from exchange integrations. + +Donations help pay for hosting, build servers, domain names, e-mail and other recurring costs. Any amount helps. + +`47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f` + +## License + +Feather is free and open-source software, [licensed under BSD-3](https://raw.githubusercontent.com/feather-wallet/feather/master/LICENSE). + +Copyright (c) 2020-2024, The Monero Project From 7c1f43ce7ca4dedbe34f5be0e44e3e4399b08aa6 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 16:28:34 +0200 Subject: [PATCH 41/76] update HACKING.md --- HACKING.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/HACKING.md b/HACKING.md index 79bd9ab..7e1dcce 100644 --- a/HACKING.md +++ b/HACKING.md @@ -1,29 +1,26 @@ # Documentation for developers -Feather is developed primarily on Linux, but can also be built and debugged on macOS. Development on Windows is not -currently supported. +Feather is developed primarily on Linux, but can also be built on macOS. Development on Windows is not currently supported. + +We support development on rolling release distributions and the latest version of Ubuntu. Building on older stable distributions is not guaranteed to work. ## Setting up a development environment ### Dependencies -Note: Feather requires Qt 6.3 or later. Make sure your distro's package manager provides this version. -If not, it is recommended that you install Qt manually using the online installer, which can be found here: -https://www.qt.io/download (under open-source). - #### Arch Linux ```bash pacman -S git cmake base-devel ccache unbound boost qrencode qt6-base qt6-svg qt6-websockets qt6-multimedia libzip hidapi protobuf zxing-cpp ``` -#### Ubuntu 22.04 +#### Ubuntu 24.04 ```bash apt update apt install git cmake build-essential ccache libssl-dev libunbound-dev libboost-all-dev libqrencode-dev \ - qt6-base-dev libgl1-mesa-dev libqt6svg6-dev libqt6websockets6-dev libzip-dev libsodium-dev libgcrypt-dev \ - libx11-xcb-dev libprotobuf-dev libhidapi-dev libzxing-dev + qt6-base-dev qt6-multimedia-dev libgl1-mesa-dev libqt6svg6-dev libqt6websockets6-dev libzip-dev libsodium-dev libgcrypt-dev \ + libx11-xcb-dev libprotobuf-dev protobuf-compiler libhidapi-dev libzxing-dev ``` #### Void Linux @@ -92,9 +89,8 @@ git submodule update --init --recursive We recommend using Jetbrains Clion for Feather development. It integrates nicely with CMake and comes with a built-in debugger. -To pass CMake flags to CLion, go to `File->Settings->Build->CMake`, set Build Type to `Debug` and set your -preferred CMake options. If you installed Qt using the online installer you may have to add -`-DCMAKE_PREFIX_PATH=/path/to/qt/installation` in the CMake options. More CMake options are documented below. +To pass CMake flags to CLion, go to `File -> Settings -> Build -> CMake`, set Build Type to `Debug` and set your +preferred CMake options. More CMake options are documented below. Run CMake (`View -> Tool Windows -> CMake`). Click on the 🔃 (`Reload CMake Project`) button. From 2764cd0cdd5f6b7ae91099a46e1e1a3e64395192 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 16:38:47 +0200 Subject: [PATCH 42/76] guix: update README.md --- contrib/guix/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 88bfd84..15c564b 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -1,13 +1,22 @@ # Bootstrappable Feather Wallet Builds -This directory contains the files necessary to perform bootstrappable Feather Wallet -builds. +This directory contains the files necessary to perform [bootstrappable](b17e) Feather Wallet builds. -[Bootstrappability][b17e] furthers our binary security guarantees by allowing us -to _audit and reproduce_ our toolchain instead of blindly _trusting_ binary -downloads. +Bootstrappability allows us to _audit and reproduce_ our toolchain instead of blindly _trusting_ binary downloads. +Our build environment can be built from source, [all the way down](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/). +It allows us to reduce our supply chain attack surface by only including the packages that we need, and nothing else. -We achieve bootstrappability by using Guix as a functional package manager. +We achieve bootstrappability by using Guix as a functional package manager. Guix runs on any Linux distribution and on +most architectures (x86_64, aarch64, riscv64). To produce reproducible release binaries, you only need to install Guix +and run the build script. + +Unlike Gitian, we are not limited to the package set of a particular Ubuntu version. Guix allows us to pick and choose +our toolchains. We are able to use the latest compilers while targeting older versions of glibc. Packages that are not +available in Guix can easily be defined in the manifest or upstreamed. + +Guix allows us to modify any detail about our build environment with ease. Debugging build issues takes less time +because we have shell access to the build environment. Our source code is bind mounted into the container, so +edits to package definitions can be tested incrementally. # Requirements From 21315e333447061bcd708da678062b62e58eded1 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 17:06:42 +0200 Subject: [PATCH 43/76] guix: update README.md --- contrib/guix/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 15c564b..e5e6e9e 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -6,18 +6,21 @@ Bootstrappability allows us to _audit and reproduce_ our toolchain instead of bl Our build environment can be built from source, [all the way down](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/). It allows us to reduce our supply chain attack surface by only including the packages that we need, and nothing else. -We achieve bootstrappability by using Guix as a functional package manager. Guix runs on any Linux distribution and on +We achieve bootstrappability by using [Guix](https://guix.gnu.org/) as a functional package manager. Guix runs on any Linux distribution and on most architectures (x86_64, aarch64, riscv64). To produce reproducible release binaries, you only need to install Guix and run the build script. -Unlike Gitian, we are not limited to the package set of a particular Ubuntu version. Guix allows us to pick and choose +Unlike [Gitian](https://github.com/devrandom/gitian-builder), we are not limited to the package set of a particular Ubuntu version. Guix allows us to pick and choose our toolchains. We are able to use the latest compilers while targeting older versions of glibc. Packages that are not -available in Guix can easily be defined in the manifest or upstreamed. +available in Guix can easily be defined in the [manifest](https://github.com/feather-wallet/feather/blob/master/contrib/guix/manifest.scm) or upstreamed. Guix allows us to modify any detail about our build environment with ease. Debugging build issues takes less time because we have shell access to the build environment. Our source code is bind mounted into the container, so edits to package definitions can be tested incrementally. +Feather releases are independently reproduced and cryptographically attested to by multiple contributors. +You can submit attestations to the [feather-sigs](https://github.com/feather-wallet/feather-sigs) repo. + # Requirements Conservatively, you will need an x86_64 machine with: From 0149b0ae9cc01db4de6b51c2ae41fe65b85623b0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 17:23:37 +0200 Subject: [PATCH 44/76] guix: readme: add quick setup guide --- contrib/guix/README.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/contrib/guix/README.md b/contrib/guix/README.md index e5e6e9e..7b407db 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -23,11 +23,34 @@ You can submit attestations to the [feather-sigs](https://github.com/feather-wal # Requirements -Conservatively, you will need an x86_64 machine with: +- any Linux distribution +- 50 GB of free disk space +- 4 or more cores recommended +- 2 GB RAM per thread -- 16GB of free disk space on the partition that /gnu/store will reside in -- 8GB of free disk space **per platform triple** you're planning on building - (see the `HOSTS` [environment variable description][env-vars-list]) +# Quick setup + +If you're just here to get a build running (e.g. to test your changes) and quickly want to get up and running: + +```bash +# Install guix +$ apt install guix # ubuntu 22.04, debian 11, or later +or +# use the install script: https://guix.gnu.org/manual/en/html_node/Binary-Installation.html + +# Clone the repo +$ git clone https://github.com/feather-wallet/feather +$ cd feather + +# Run the build +$ ./contrib/guix/guix-build # this will build all targets using all available cores +or +$ JOBS=N ./contrib/guix/guix-build # this will limit the amount of threads to N +or +$ HOSTS="x86_64-linux-gnu" ./contrib/guix/guix-build # to only build the x86_64 linux target +``` + +If you're looking to submit an attestation, follow the instructions below. # Installation and Setup From 0555b6ab54b6241876779a2f5b1efd3565e13c3e Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 17:36:35 +0200 Subject: [PATCH 45/76] guix: update readme --- contrib/guix/README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 7b407db..a33abb8 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -1,22 +1,19 @@ # Bootstrappable Feather Wallet Builds -This directory contains the files necessary to perform [bootstrappable](b17e) Feather Wallet builds. +This directory contains the files necessary to perform [bootstrappable](https://bootstrappable.org) Feather Wallet builds. Bootstrappability allows us to _audit and reproduce_ our toolchain instead of blindly _trusting_ binary downloads. Our build environment can be built from source, [all the way down](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/). -It allows us to reduce our supply chain attack surface by only including the packages that we need, and nothing else. We achieve bootstrappability by using [Guix](https://guix.gnu.org/) as a functional package manager. Guix runs on any Linux distribution and on most architectures (x86_64, aarch64, riscv64). To produce reproducible release binaries, you only need to install Guix and run the build script. -Unlike [Gitian](https://github.com/devrandom/gitian-builder), we are not limited to the package set of a particular Ubuntu version. Guix allows us to pick and choose -our toolchains. We are able to use the latest compilers while targeting older versions of glibc. Packages that are not -available in Guix can easily be defined in the [manifest](https://github.com/feather-wallet/feather/blob/master/contrib/guix/manifest.scm) or upstreamed. - -Guix allows us to modify any detail about our build environment with ease. Debugging build issues takes less time -because we have shell access to the build environment. Our source code is bind mounted into the container, so -edits to package definitions can be tested incrementally. +Guix allows us to modify any detail about our build environment with ease. +Unlike [Gitian](https://github.com/devrandom/gitian-builder), we are not limited to the package set of a particular Ubuntu version. +With Guix, we can configure our toolchains to use the latest compilers while still targeting older versions of glibc. +We drastically reduce our supply chain attack surface by only including the package we need in our build environment, and nothing else. +Packages that are not available in Guix can easily be defined in the [manifest](https://github.com/feather-wallet/feather/blob/master/contrib/guix/manifest.scm) or upstreamed. Feather releases are independently reproduced and cryptographically attested to by multiple contributors. You can submit attestations to the [feather-sigs](https://github.com/feather-wallet/feather-sigs) repo. @@ -397,6 +394,5 @@ used. If you start `guix-daemon` using an init script, you can edit said script to supply this flag. -[b17e]: https://bootstrappable.org/ [r12e/source-date-epoch]: https://reproducible-builds.org/docs/source-date-epoch/ [env-vars-list]: #recognized-environment-variables From eb31fca27e2b3000964d91baeb3946a0edccd2e0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 17:56:00 +0200 Subject: [PATCH 46/76] guix: readme: improve quick setup --- contrib/guix/README.md | 51 +++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/contrib/guix/README.md b/contrib/guix/README.md index a33abb8..689910b 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -29,25 +29,44 @@ You can submit attestations to the [feather-sigs](https://github.com/feather-wal If you're just here to get a build running (e.g. to test your changes) and quickly want to get up and running: +### Install Guix + +On Ubuntu 22.04, Debian 11, or later: + ```bash -# Install guix -$ apt install guix # ubuntu 22.04, debian 11, or later -or -# use the install script: https://guix.gnu.org/manual/en/html_node/Binary-Installation.html - -# Clone the repo -$ git clone https://github.com/feather-wallet/feather -$ cd feather - -# Run the build -$ ./contrib/guix/guix-build # this will build all targets using all available cores -or -$ JOBS=N ./contrib/guix/guix-build # this will limit the amount of threads to N -or -$ HOSTS="x86_64-linux-gnu" ./contrib/guix/guix-build # to only build the x86_64 linux target +$ apt install guix ``` -If you're looking to submit an attestation, follow the instructions below. +If Guix is not available in your package manager, use the official [install script](https://guix.gnu.org/manual/en/html_node/Binary-Installation.html). + +### Clone the repo + +```bash +$ git clone https://github.com/feather-wallet/feather +$ cd feather +``` + +### Run the build + +To build all targets using all available cores: + +```bash +$ ./contrib/guix/guix-build +``` + +To limit the number of threads to N: + +``` +$ JOBS=N ./contrib/guix/guix-build +``` + +To only build the x86_64 linux target: + +``` +$ HOSTS="x86_64-linux-gnu" ./contrib/guix/guix-build +``` + +More recognized environment variables can be found further below. # Installation and Setup From 5dee7b3e1db3b8b733e7f797fb1009353827558a Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 18:08:44 +0200 Subject: [PATCH 47/76] README: fix links, add RSK --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f60e740..aa34722 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,12 @@ You can download Feather from **[featherwallet.org](https://featherwallet.org/do If you need help installing installing Feather, check the [installation documentation](https://docs.featherwallet.org/). -Releases are signed with our [release signing key](https://docs.featherwallet.org/guides/release-signing-key). +Releases are signed with our [release signing key](https://docs.featherwallet.org/guides/release-signing-key). The fingerprint is: + +``` +8185 E158 A333 30C7 FD61 BC0D 1F76 E155 CEFB A71C +``` + We recommend that you verify downloads with GPG. ## Resources @@ -33,9 +38,9 @@ If you don’t receive a response immediately please idle in the room. To learn how to run a bootstrappable release build, see: [contrib/guix/README.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md) -For release attestations, see: http://github.com/feather-wallet/feather-sigs +For release attestations, see the [feather-sigs](http://github.com/feather-wallet/feather-sigs) repo. -For release policy, see: [RELEASE.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/RELEASE.md) +For release policy, see: [RELEASE.md](https://github.com/feather-wallet/feather/blob/master/RELEASE.md) ## Development @@ -44,9 +49,9 @@ If you are looking to set up a development environment for Feather, see [HACKING It is highly recommended that you join our Matrix or IRC channel if you are hacking on Feather. Idling in this channel is the best way to stay updated on best practices and new developments. -For information on how Feather is maintained, see: [MAINTENANCE.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/MAINTENANCE.md) +For information on how Feather is maintained, see: [MAINTENANCE.md](https://github.com/feather-wallet/feather/blob/master/MAINTENANCE.md) -To report a security vulnerability, see: [SECURITY.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/RELEASE.md) +To report a security vulnerability, see: [SECURITY.md](https://github.com/feather-wallet/feather/blob/master/RELEASE.md) ## Support From 19bb1c0d992b573427295f2a0db44b7d1fdf8fa7 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 3 Oct 2024 18:16:40 +0200 Subject: [PATCH 48/76] README: fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa34722..1356591 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Idling in this channel is the best way to stay updated on best practices and new For information on how Feather is maintained, see: [MAINTENANCE.md](https://github.com/feather-wallet/feather/blob/master/MAINTENANCE.md) -To report a security vulnerability, see: [SECURITY.md](https://github.com/feather-wallet/feather/blob/master/RELEASE.md) +To report a security vulnerability, see: [SECURITY.md](https://github.com/feather-wallet/feather/blob/master/SECURITY.md) ## Support From 352ae7fa69be5091a3c8b24adc5a80210bb27056 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 4 Oct 2024 13:31:15 +0200 Subject: [PATCH 49/76] depends: unbound: patch for CVE-2024-8508 --- contrib/depends/packages/unbound.mk | 2 + .../patches/unbound/CVE-2024-8508.patch | 236 ++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 contrib/depends/patches/unbound/CVE-2024-8508.patch diff --git a/contrib/depends/packages/unbound.mk b/contrib/depends/packages/unbound.mk index 20bbef8..d6cea63 100644 --- a/contrib/depends/packages/unbound.mk +++ b/contrib/depends/packages/unbound.mk @@ -4,6 +4,7 @@ $(package)_download_path=https://www.nlnetlabs.nl/downloads/$(package)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=e7dca7d6b0f81bdfa6fa64ebf1053b5a999a5ae9278a87ef182425067ea14521 $(package)_dependencies=openssl expat +$(package)_patches += CVE-2024-8508.patch define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-static --without-pyunbound --prefix=$(host_prefix) @@ -18,6 +19,7 @@ endef define $(package)_preprocess_cmds rm configure~ doc/IP-BasedActions.pdf doc/ietf67-design-02.odp doc/ietf67-design-02.pdf doc/CNAME-basedRedirectionDesignNotes.pdf &&\ rm -rf testdata dnscrypt/testdata &&\ + patch -p1 -i $($(package)_patch_dir)/CVE-2024-8508.patch && \ autoconf endef diff --git a/contrib/depends/patches/unbound/CVE-2024-8508.patch b/contrib/depends/patches/unbound/CVE-2024-8508.patch new file mode 100644 index 0000000..06a6e63 --- /dev/null +++ b/contrib/depends/patches/unbound/CVE-2024-8508.patch @@ -0,0 +1,236 @@ +diff --git a/util/data/msgencode.c b/util/data/msgencode.c +index 898ff841..6d116fb5 100644 +--- a/util/data/msgencode.c ++++ b/util/data/msgencode.c +@@ -62,6 +62,10 @@ + #define RETVAL_TRUNC -4 + /** return code that means all is peachy keen. Equal to DNS rcode NOERROR */ + #define RETVAL_OK 0 ++/** Max compressions we are willing to perform; more than that will result ++ * in semi-compressed messages, or truncated even on TCP for huge messages, to ++ * avoid locking the CPU for long */ ++#define MAX_COMPRESSION_PER_MESSAGE 120 + + /** + * Data structure to help domain name compression in outgoing messages. +@@ -284,15 +288,17 @@ write_compressed_dname(sldns_buffer* pkt, uint8_t* dname, int labs, + + /** compress owner name of RR, return RETVAL_OUTMEM RETVAL_TRUNC */ + static int +-compress_owner(struct ub_packed_rrset_key* key, sldns_buffer* pkt, +- struct regional* region, struct compress_tree_node** tree, +- size_t owner_pos, uint16_t* owner_ptr, int owner_labs) ++compress_owner(struct ub_packed_rrset_key* key, sldns_buffer* pkt, ++ struct regional* region, struct compress_tree_node** tree, ++ size_t owner_pos, uint16_t* owner_ptr, int owner_labs, ++ size_t* compress_count) + { + struct compress_tree_node* p; + struct compress_tree_node** insertpt = NULL; + if(!*owner_ptr) { + /* compress first time dname */ +- if((p = compress_tree_lookup(tree, key->rk.dname, ++ if(*compress_count < MAX_COMPRESSION_PER_MESSAGE && ++ (p = compress_tree_lookup(tree, key->rk.dname, + owner_labs, &insertpt))) { + if(p->labs == owner_labs) + /* avoid ptr chains, since some software is +@@ -301,6 +307,7 @@ compress_owner(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + if(!write_compressed_dname(pkt, key->rk.dname, + owner_labs, p)) + return RETVAL_TRUNC; ++ (*compress_count)++; + /* check if typeclass+4 ttl + rdatalen is available */ + if(sldns_buffer_remaining(pkt) < 4+4+2) + return RETVAL_TRUNC; +@@ -313,7 +320,8 @@ compress_owner(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + if(owner_pos <= PTR_MAX_OFFSET) + *owner_ptr = htons(PTR_CREATE(owner_pos)); + } +- if(!compress_tree_store(key->rk.dname, owner_labs, ++ if(*compress_count < MAX_COMPRESSION_PER_MESSAGE && ++ !compress_tree_store(key->rk.dname, owner_labs, + owner_pos, region, p, insertpt)) + return RETVAL_OUTMEM; + } else { +@@ -333,20 +341,24 @@ compress_owner(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + + /** compress any domain name to the packet, return RETVAL_* */ + static int +-compress_any_dname(uint8_t* dname, sldns_buffer* pkt, int labs, +- struct regional* region, struct compress_tree_node** tree) ++compress_any_dname(uint8_t* dname, sldns_buffer* pkt, int labs, ++ struct regional* region, struct compress_tree_node** tree, ++ size_t* compress_count) + { + struct compress_tree_node* p; + struct compress_tree_node** insertpt = NULL; + size_t pos = sldns_buffer_position(pkt); +- if((p = compress_tree_lookup(tree, dname, labs, &insertpt))) { ++ if(*compress_count < MAX_COMPRESSION_PER_MESSAGE && ++ (p = compress_tree_lookup(tree, dname, labs, &insertpt))) { + if(!write_compressed_dname(pkt, dname, labs, p)) + return RETVAL_TRUNC; ++ (*compress_count)++; + } else { + if(!dname_buffer_write(pkt, dname)) + return RETVAL_TRUNC; + } +- if(!compress_tree_store(dname, labs, pos, region, p, insertpt)) ++ if(*compress_count < MAX_COMPRESSION_PER_MESSAGE && ++ !compress_tree_store(dname, labs, pos, region, p, insertpt)) + return RETVAL_OUTMEM; + return RETVAL_OK; + } +@@ -364,9 +376,9 @@ type_rdata_compressable(struct ub_packed_rrset_key* key) + + /** compress domain names in rdata, return RETVAL_* */ + static int +-compress_rdata(sldns_buffer* pkt, uint8_t* rdata, size_t todolen, +- struct regional* region, struct compress_tree_node** tree, +- const sldns_rr_descriptor* desc) ++compress_rdata(sldns_buffer* pkt, uint8_t* rdata, size_t todolen, ++ struct regional* region, struct compress_tree_node** tree, ++ const sldns_rr_descriptor* desc, size_t* compress_count) + { + int labs, r, rdf = 0; + size_t dname_len, len, pos = sldns_buffer_position(pkt); +@@ -380,8 +392,8 @@ compress_rdata(sldns_buffer* pkt, uint8_t* rdata, size_t todolen, + switch(desc->_wireformat[rdf]) { + case LDNS_RDF_TYPE_DNAME: + labs = dname_count_size_labels(rdata, &dname_len); +- if((r=compress_any_dname(rdata, pkt, labs, region, +- tree)) != RETVAL_OK) ++ if((r=compress_any_dname(rdata, pkt, labs, region, ++ tree, compress_count)) != RETVAL_OK) + return r; + rdata += dname_len; + todolen -= dname_len; +@@ -449,7 +461,8 @@ static int + packed_rrset_encode(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + uint16_t* num_rrs, time_t timenow, struct regional* region, + int do_data, int do_sig, struct compress_tree_node** tree, +- sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset) ++ sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset, ++ size_t* compress_count) + { + size_t i, j, owner_pos; + int r, owner_labs; +@@ -477,9 +490,9 @@ packed_rrset_encode(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + for(i=0; icount; i++) { + /* rrset roundrobin */ + j = (i + rr_offset) % data->count; +- if((r=compress_owner(key, pkt, region, tree, +- owner_pos, &owner_ptr, owner_labs)) +- != RETVAL_OK) ++ if((r=compress_owner(key, pkt, region, tree, ++ owner_pos, &owner_ptr, owner_labs, ++ compress_count)) != RETVAL_OK) + return r; + sldns_buffer_write(pkt, &key->rk.type, 2); + sldns_buffer_write(pkt, &key->rk.rrset_class, 2); +@@ -489,8 +502,8 @@ packed_rrset_encode(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + else sldns_buffer_write_u32(pkt, data->rr_ttl[j]-adjust); + if(c) { + if((r=compress_rdata(pkt, data->rr_data[j], +- data->rr_len[j], region, tree, c)) +- != RETVAL_OK) ++ data->rr_len[j], region, tree, c, ++ compress_count)) != RETVAL_OK) + return r; + } else { + if(sldns_buffer_remaining(pkt) < data->rr_len[j]) +@@ -510,9 +523,9 @@ packed_rrset_encode(struct ub_packed_rrset_key* key, sldns_buffer* pkt, + return RETVAL_TRUNC; + sldns_buffer_write(pkt, &owner_ptr, 2); + } else { +- if((r=compress_any_dname(key->rk.dname, +- pkt, owner_labs, region, tree)) +- != RETVAL_OK) ++ if((r=compress_any_dname(key->rk.dname, ++ pkt, owner_labs, region, tree, ++ compress_count)) != RETVAL_OK) + return r; + if(sldns_buffer_remaining(pkt) < + 4+4+data->rr_len[i]) +@@ -544,7 +557,8 @@ static int + insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs, + sldns_buffer* pkt, size_t rrsets_before, time_t timenow, + struct regional* region, struct compress_tree_node** tree, +- sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset) ++ sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset, ++ size_t* compress_count) + { + int r; + size_t i, setstart; +@@ -560,7 +574,7 @@ insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs, + setstart = sldns_buffer_position(pkt); + if((r=packed_rrset_encode(rep->rrsets[rrsets_before+i], + pkt, num_rrs, timenow, region, 1, 1, tree, +- s, qtype, dnssec, rr_offset)) ++ s, qtype, dnssec, rr_offset, compress_count)) + != RETVAL_OK) { + /* Bad, but if due to size must set TC bit */ + /* trim off the rrset neatly. */ +@@ -573,7 +587,7 @@ insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs, + setstart = sldns_buffer_position(pkt); + if((r=packed_rrset_encode(rep->rrsets[rrsets_before+i], + pkt, num_rrs, timenow, region, 1, 0, tree, +- s, qtype, dnssec, rr_offset)) ++ s, qtype, dnssec, rr_offset, compress_count)) + != RETVAL_OK) { + sldns_buffer_set_position(pkt, setstart); + return r; +@@ -584,7 +598,7 @@ insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs, + setstart = sldns_buffer_position(pkt); + if((r=packed_rrset_encode(rep->rrsets[rrsets_before+i], + pkt, num_rrs, timenow, region, 0, 1, tree, +- s, qtype, dnssec, rr_offset)) ++ s, qtype, dnssec, rr_offset, compress_count)) + != RETVAL_OK) { + sldns_buffer_set_position(pkt, setstart); + return r; +@@ -677,6 +691,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, + struct compress_tree_node* tree = 0; + int r; + size_t rr_offset; ++ size_t compress_count=0; + + sldns_buffer_clear(buffer); + if(udpsize < sldns_buffer_limit(buffer)) +@@ -723,7 +738,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, + arep.rrsets = &qinfo->local_alias->rrset; + if((r=insert_section(&arep, 1, &ancount, buffer, 0, + timezero, region, &tree, LDNS_SECTION_ANSWER, +- qinfo->qtype, dnssec, rr_offset)) != RETVAL_OK) { ++ qinfo->qtype, dnssec, rr_offset, &compress_count)) != RETVAL_OK) { + if(r == RETVAL_TRUNC) { + /* create truncated message */ + sldns_buffer_write_u16_at(buffer, 6, ancount); +@@ -738,7 +753,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, + /* insert answer section */ + if((r=insert_section(rep, rep->an_numrrsets, &ancount, buffer, + 0, timenow, region, &tree, LDNS_SECTION_ANSWER, qinfo->qtype, +- dnssec, rr_offset)) != RETVAL_OK) { ++ dnssec, rr_offset, &compress_count)) != RETVAL_OK) { + if(r == RETVAL_TRUNC) { + /* create truncated message */ + sldns_buffer_write_u16_at(buffer, 6, ancount); +@@ -756,7 +771,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, + if((r=insert_section(rep, rep->ns_numrrsets, &nscount, buffer, + rep->an_numrrsets, timenow, region, &tree, + LDNS_SECTION_AUTHORITY, qinfo->qtype, +- dnssec, rr_offset)) != RETVAL_OK) { ++ dnssec, rr_offset, &compress_count)) != RETVAL_OK) { + if(r == RETVAL_TRUNC) { + /* create truncated message */ + sldns_buffer_write_u16_at(buffer, 8, nscount); +@@ -773,7 +788,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, + if((r=insert_section(rep, rep->ar_numrrsets, &arcount, buffer, + rep->an_numrrsets + rep->ns_numrrsets, timenow, region, + &tree, LDNS_SECTION_ADDITIONAL, qinfo->qtype, +- dnssec, rr_offset)) != RETVAL_OK) { ++ dnssec, rr_offset, &compress_count)) != RETVAL_OK) { + if(r == RETVAL_TRUNC) { + /* no need to set TC bit, this is the additional */ + sldns_buffer_write_u16_at(buffer, 10, arcount); From 00915ee8a03acc0ea6e7291c73f50fe9e6ea2827 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 4 Oct 2024 15:28:08 +0200 Subject: [PATCH 50/76] depends: cleanup toolchain --- contrib/depends/toolchain.cmake.in | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index b7e6f7e..0834d2c 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -3,12 +3,7 @@ SET(CMAKE_SYSTEM_NAME @depends@) SET(CMAKE_SYSTEM_PROCESSOR @arch@) SET(CMAKE_BUILD_TYPE @release_type@) -OPTION(STATIC "Link libraries statically" ON) -OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF) -OPTION(BUILD_TESTS "Build tests." OFF) - SET(STATIC ON) -SET(UNBOUND_STATIC ON) SET(ARCH "default") SET(BUILD_TESTS @build_tests@) @@ -43,17 +38,9 @@ SET(absl_ROOT @prefix@) SET(NATIVE_BIN_PATH @prefix@/native/bin CACHE FILEPATH "path to native binaries" FORCE) SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE) -if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") -SET(LIBUNWIND_INCLUDE_DIR @prefix@/include) -SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a) -SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib) - if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") SET(LIBUSB-1.0_LIBRARY @prefix@/lib/libusb-1.0.a) SET(LIBUDEV_LIBRARY @prefix@/lib/libudev.a) - -endif() - endif() SET(ZMQ_INCLUDE_PATH @prefix@/include) @@ -116,22 +103,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") SET(CMAKE_CXX_STANDARD 17) SET(LLVM_ENABLE_PIC OFF) SET(LLVM_ENABLE_PIE OFF) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") - SET(ANDROID TRUE) - if(ARCHITECTURE STREQUAL "arm") - SET(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") - SET(CMAKE_SYSTEM_PROCESSOR "armv7-a") - SET(CMAKE_ANDROID_ARM_MODE ON) - SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi) - SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi) - SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi-) - elseif(ARCHITECTURE STREQUAL "aarch64") - SET(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") - SET(CMAKE_SYSTEM_PROCESSOR "aarch64") - endif() - SET(CMAKE_ANDROID_STANDALONE_TOOLCHAIN @prefix@/native) - SET(CMAKE_C_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang") - SET(CMAKE_CXX_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang++") else() SET(CMAKE_C_COMPILER @CC@) SET(CMAKE_CXX_COMPILER @CXX@) From da0d7e7100eca7a2b693b4050cea461e90117f94 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 4 Oct 2024 16:08:51 +0200 Subject: [PATCH 51/76] settings: add option to show fiat balance in statusbar --- src/MainWindow.cpp | 13 +++++++++++++ src/MainWindow.h | 1 + src/SettingsDialog.cpp | 9 +++++++++ src/SettingsDialog.ui | 13 ++++++++++--- src/utils/Utils.cpp | 1 + src/utils/config.cpp | 1 + src/utils/config.h | 1 + src/widgets/TickerWidget.cpp | 2 +- 8 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e4944a2..b3d9189 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -116,6 +116,9 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa this->onWalletOpened(); + connect(&appData()->prices, &Prices::fiatPricesUpdated, this, &MainWindow::updateBalance); + connect(&appData()->prices, &Prices::cryptoPricesUpdated, this, &MainWindow::updateBalance); + #ifdef DONATE_BEG this->donationNag(); #endif @@ -581,6 +584,10 @@ void MainWindow::onWalletOpened() { } } +void MainWindow::updateBalance() { + this->onBalanceUpdated(m_wallet->balance(), m_wallet->unlockedBalance()); +} + void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) { bool hide = conf()->get(Config::hideBalance).toBool(); int displaySetting = conf()->get(Config::balanceDisplay).toInt(); @@ -601,6 +608,12 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) { } } + if (conf()->get(Config::balanceShowFiat).toBool()) { + QString fiatCurrency = conf()->get(Config::preferredFiatCurrency).toString(); + double balanceFiatAmount = appData()->prices.convert("XMR", fiatCurrency, balance / constants::cdiv); + balance_str += QString(" (%1)").arg(Utils::amountToCurrencyString(balanceFiatAmount, fiatCurrency)); + } + m_statusLabelBalance->setToolTip("Click for details"); m_statusLabelBalance->setText(balance_str); } diff --git a/src/MainWindow.h b/src/MainWindow.h index bab68a3..9e15b0c 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -131,6 +131,7 @@ private slots: void onTxPoolBacklog(const QVector &backlog, quint64 originalFeeLevel, quint64 automaticFeeLevel); // libwalletqt + void updateBalance(); void onBalanceUpdated(quint64 balance, quint64 spendable); void onSyncStatus(quint64 height, quint64 target, bool daemonSync); void onWalletOpened(); diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 3ad8c75..f84058e 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -131,10 +131,18 @@ void Settings::setupAppearanceTab() { emit updateBalance(); }); + // [Balance show fiat] + ui->checkBox_balanceShowFiat->setChecked(conf()->get(Config::balanceShowFiat).toBool()); + connect(ui->checkBox_balanceShowFiat, &QCheckBox::toggled, [this](bool toggled){ + conf()->set(Config::balanceShowFiat, toggled); + emit updateBalance(); + }); + // [Preferred fiat currency] QStringList availableFiatCurrencies = appData()->prices.rates.keys(); for (const auto ¤cy : availableFiatCurrencies) { ui->comboBox_fiatCurrency->addItem(currency); + emit updateBalance(); } QStringList fiatCurrencies; @@ -151,6 +159,7 @@ void Settings::setupAppearanceTab() { QString selection = ui->comboBox_fiatCurrency->itemText(index); conf()->set(Config::preferredFiatCurrency, selection); emit preferredFiatCurrencyChanged(selection); + emit updateBalance(); }); } diff --git a/src/SettingsDialog.ui b/src/SettingsDialog.ui index 578dfa7..df2c05a 100644 --- a/src/SettingsDialog.ui +++ b/src/SettingsDialog.ui @@ -129,17 +129,17 @@ - + Fiat currency: - + - + Qt::Vertical @@ -152,6 +152,13 @@ + + + + Show fiat balance in statusbar + + + diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index ed26b42..dc22888 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -439,6 +439,7 @@ QLocale getCurrencyLocale(const QString ¤cyCode) { for (const auto& locale_: allLocales) { if (locale_.currencySymbol(QLocale::CurrencyIsoCode) == currencyCode) { locale = locale_; + break; } } localeCache[currencyCode] = locale; diff --git a/src/utils/config.cpp b/src/utils/config.cpp index a17addf..e204807 100644 --- a/src/utils/config.cpp +++ b/src/utils/config.cpp @@ -80,6 +80,7 @@ static const QHash configStrings = { {Config::dateFormat, {QS("dateFormat"), "yyyy-MM-dd"}}, {Config::timeFormat, {QS("timeFormat"), "HH:mm"}}, {Config::balanceDisplay, {QS("balanceDisplay"), Config::BalanceDisplay::spendablePlusUnconfirmed}}, + {Config::balanceShowFiat, {QS("balanceShowFiat"), false}}, {Config::inactivityLockEnabled, {QS("inactivityLockEnabled"), false}}, {Config::inactivityLockTimeout, {QS("inactivityLockTimeout"), 10}}, {Config::lockOnMinimize, {QS("lockOnMinimize"), false}}, diff --git a/src/utils/config.h b/src/utils/config.h index 215ec6b..b83b4f4 100644 --- a/src/utils/config.h +++ b/src/utils/config.h @@ -80,6 +80,7 @@ public: dateFormat, timeFormat, balanceDisplay, + balanceShowFiat, preferredFiatCurrency, // Network -> Proxy diff --git a/src/widgets/TickerWidget.cpp b/src/widgets/TickerWidget.cpp index cecd7e9..86dfe58 100644 --- a/src/widgets/TickerWidget.cpp +++ b/src/widgets/TickerWidget.cpp @@ -67,7 +67,7 @@ BalanceTickerWidget::BalanceTickerWidget(QWidget *parent, Wallet *wallet, bool t connect(m_wallet, &Wallet::balanceUpdated, this, &BalanceTickerWidget::updateDisplay); connect(&appData()->prices, &Prices::fiatPricesUpdated, this, &BalanceTickerWidget::updateDisplay); - connect(&appData()->prices, &Prices::fiatPricesUpdated, this, &BalanceTickerWidget::updateDisplay); + connect(&appData()->prices, &Prices::cryptoPricesUpdated, this, &BalanceTickerWidget::updateDisplay); } void BalanceTickerWidget::updateDisplay() { From b0a64231b96bc778d977189b7e8b67b9db04d7e2 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 6 Oct 2024 17:19:45 +0200 Subject: [PATCH 52/76] txinfo: warn if integrated address is missing --- monero | 2 +- src/dialog/TxInfoDialog.cpp | 16 ++++++++++++++++ src/dialog/TxInfoDialog.ui | 20 +++++++++++++++++++- src/libwalletqt/TransactionHistory.cpp | 6 +++--- src/libwalletqt/rows/TransactionRow.cpp | 4 ++++ src/libwalletqt/rows/TransactionRow.h | 1 + 6 files changed, 44 insertions(+), 5 deletions(-) diff --git a/monero b/monero index 16e051c..d50ba72 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit 16e051c8a880a63aacdd217f24c55f9f6154bb00 +Subproject commit d50ba728d79cc3a96c928f7736503268ad567cba diff --git a/src/dialog/TxInfoDialog.cpp b/src/dialog/TxInfoDialog.cpp index e014cb1..a9cd5b6 100644 --- a/src/dialog/TxInfoDialog.cpp +++ b/src/dialog/TxInfoDialog.cpp @@ -70,10 +70,14 @@ TxInfoDialog::TxInfoDialog(Wallet *wallet, TransactionRow *txInfo, QWidget *pare ui->frameInputs->hide(); // } + ui->frame_destinationsWarning->hide(); + QTextCursor cursor = ui->outputs->textCursor(); auto transfers = txInfo->transfers(); if (!transfers.isEmpty()) { + bool hasIntegrated = false; + for (const auto& transfer : transfers) { auto address = transfer->address(); auto amount = WalletManager::displayAmount(transfer->amount()); @@ -81,9 +85,21 @@ TxInfoDialog::TxInfoDialog(Wallet *wallet, TransactionRow *txInfo, QWidget *pare cursor.insertText(address, Utils::addressTextFormat(index, transfer->amount())); cursor.insertText(QString(" %1").arg(amount), QTextCharFormat()); cursor.insertBlock(); + + if (WalletManager::baseAddressFromIntegratedAddress(transfer->address(), constants::networkType) != transfer->address()) { + hasIntegrated = true; + } } ui->label_outputs->setText(QString("Destinations (%2)").arg(QString::number(transfers.size()))); this->adjustHeight(ui->outputs, transfers.size()); + + // Trezor saves a mangled payment ID. + if (m_wallet->isTrezor() && !hasIntegrated && txInfo->hasPaymentId()) { + ui->frame_destinationsWarning->setInfo(icons()->icon("warning"), "The address displayed here does not contain a payment ID. " + "If you are making a repeat payment to a service, " + "do not copy the address from here to prevent a loss of funds."); + ui->frame_destinationsWarning->show(); + } } else { ui->frameOutputs->hide(); } diff --git a/src/dialog/TxInfoDialog.ui b/src/dialog/TxInfoDialog.ui index 22405d9..ca9cecd 100644 --- a/src/dialog/TxInfoDialog.ui +++ b/src/dialog/TxInfoDialog.ui @@ -7,7 +7,7 @@ 0 0 929 - 715 + 723 @@ -184,6 +184,16 @@ + + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -287,6 +297,14 @@ + + + InfoFrame + QFrame +
components.h
+ 1 +
+
diff --git a/src/libwalletqt/TransactionHistory.cpp b/src/libwalletqt/TransactionHistory.cpp index 905af2d..064352d 100644 --- a/src/libwalletqt/TransactionHistory.cpp +++ b/src/libwalletqt/TransactionHistory.cpp @@ -75,10 +75,10 @@ void TransactionHistory::refresh() clearRows(); quint64 lastTxHeight = 0; + bool hasFakePaymentId = m_wallet->isTrezor(); m_locked = false; m_minutesToUnlock = 0; - uint64_t min_height = 0; uint64_t max_height = (uint64_t)-1; uint64_t wallet_height = m_wallet->blockChainHeight(); @@ -176,7 +176,7 @@ void TransactionHistory::refresh() // single output transaction might contain multiple transfers for (auto const &d: pd.m_dests) { - Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id)), this); + Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id, !hasFakePaymentId)), this); t->m_transfers.append(transfer); } for (auto const &r: pd.m_rings) @@ -229,7 +229,7 @@ void TransactionHistory::refresh() for (auto const &d: pd.m_dests) { - Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id)), this); + Transfer *transfer = new Transfer(d.amount, QString::fromStdString(d.address(m_wallet2->nettype(), pd.m_payment_id, !hasFakePaymentId)), this); t->m_transfers.append(transfer); } for (auto const &r: pd.m_rings) diff --git a/src/libwalletqt/rows/TransactionRow.cpp b/src/libwalletqt/rows/TransactionRow.cpp index 0edb315..ff6ab30 100644 --- a/src/libwalletqt/rows/TransactionRow.cpp +++ b/src/libwalletqt/rows/TransactionRow.cpp @@ -167,6 +167,10 @@ QString TransactionRow::rings_formatted() const return rings; } +bool TransactionRow::hasPaymentId() const { + return m_paymentId != "0000000000000000"; +} + TransactionRow::~TransactionRow() { qDeleteAll(m_transfers); diff --git a/src/libwalletqt/rows/TransactionRow.h b/src/libwalletqt/rows/TransactionRow.h index 68b21e2..34d6f58 100644 --- a/src/libwalletqt/rows/TransactionRow.h +++ b/src/libwalletqt/rows/TransactionRow.h @@ -52,6 +52,7 @@ public: QList destinations() const; QList transfers() const; QString rings_formatted() const; + bool hasPaymentId() const; private: explicit TransactionRow(QObject *parent); From f3cd34672311492c426fa0f13d9f9769c6652f95 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 6 Oct 2024 20:05:27 +0200 Subject: [PATCH 53/76] build: replace AppImage runtime with UPX --- contrib/AppImage/AppRun | 8 - contrib/AppImage/build-appimage.sh | 33 ----- contrib/depends/packages/appimage_runtime.mk | 23 --- contrib/depends/packages/libfuse.mk | 32 ---- contrib/depends/packages/libsquashfuse.mk | 28 ---- contrib/depends/packages/packages.mk | 2 +- contrib/depends/packages/zstd.mk | 16 -- .../appimage_runtime/depends-fix.patch | 30 ---- contrib/depends/patches/libfuse/mount.c.diff | 139 ------------------ .../depends/patches/libfuse/no-dlopen.patch | 64 -------- .../patches/libfuse/set_fusermount_path.patch | 13 -- contrib/depends/patches/libfuse/toolchain.txt | 20 --- contrib/depends/toolchain.cmake.in | 13 ++ contrib/guix/libexec/build.sh | 8 +- contrib/guix/manifest.scm | 1 + 15 files changed, 21 insertions(+), 409 deletions(-) delete mode 100644 contrib/AppImage/AppRun delete mode 100755 contrib/AppImage/build-appimage.sh delete mode 100644 contrib/depends/packages/appimage_runtime.mk delete mode 100644 contrib/depends/packages/libfuse.mk delete mode 100644 contrib/depends/packages/libsquashfuse.mk delete mode 100644 contrib/depends/packages/zstd.mk delete mode 100644 contrib/depends/patches/appimage_runtime/depends-fix.patch delete mode 100644 contrib/depends/patches/libfuse/mount.c.diff delete mode 100644 contrib/depends/patches/libfuse/no-dlopen.patch delete mode 100644 contrib/depends/patches/libfuse/set_fusermount_path.patch delete mode 100644 contrib/depends/patches/libfuse/toolchain.txt diff --git a/contrib/AppImage/AppRun b/contrib/AppImage/AppRun deleted file mode 100644 index dc50855..0000000 --- a/contrib/AppImage/AppRun +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -HERE="$(dirname "$(readlink -f "${0}")")" -echo $HERE - -# Tails 5.8 sets QT_QPA_PLATFORM to wayland which breaks our app -export QT_QPA_PLATFORM=xcb -${APPDIR}/usr/bin/feather $* diff --git a/contrib/AppImage/build-appimage.sh b/contrib/AppImage/build-appimage.sh deleted file mode 100755 index 750ecf8..0000000 --- a/contrib/AppImage/build-appimage.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -e -unset SOURCE_DATE_EPOCH - -# Manually create the AppImage (reproducibly) since linuxdeployqt is not able to create cross-compiled AppImages - -APPDIR="$PWD/feather.AppDir" - -mkdir -p "$APPDIR" -mkdir -p "$APPDIR/usr/share/applications/" -mkdir -p "$APPDIR/usr/bin" - -cp "src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop" -cp "src/assets/feather.desktop" "$APPDIR/feather.desktop" -cp "src/assets/images/appicons/64x64.png" "$APPDIR/feather.png" -cp "build/bin/feather" "$APPDIR/usr/bin/feather" -chmod +x "$APPDIR/usr/bin/feather" - -cp "contrib/AppImage/AppRun" "$APPDIR/" -chmod +x "$APPDIR/AppRun" - -find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \; - -mksquashfs feather.AppDir feather.squashfs -comp zstd -info -root-owned -no-xattrs -noappend -fstime 0 -# mksquashfs writes a timestamp to the header -printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8)) - -rm -f feather.AppImage - -cat /feather/contrib/depends/${HOST}/runtime >> feather.AppImage -cat feather.squashfs >> feather.AppImage -chmod a+x feather.AppImage diff --git a/contrib/depends/packages/appimage_runtime.mk b/contrib/depends/packages/appimage_runtime.mk deleted file mode 100644 index 6077de2..0000000 --- a/contrib/depends/packages/appimage_runtime.mk +++ /dev/null @@ -1,23 +0,0 @@ -package=appimage_runtime -$(package)_version=c9553b05938b22849ac3255ac923bf8e775ce539 -$(package)_download_path=https://github.com/AppImage/type2-runtime/archive/ -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=4a27451013b571cf9f5a13660719d091cc79f2344aafa2e48578ddc0e4618af1 -$(package)_dependencies=libsquashfuse zstd -$(package)_patches=depends-fix.patch - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/depends-fix.patch -endef - -define $(package)_build_cmds - cd src/runtime && \ - export host_prefix="$(host_prefix)" && \ - $(MAKE) runtime-fuse3 -e CC=$($(package)_cc) LDLAGS="$($(package)_ldflags)" && \ - "${HOST}-strip" runtime-fuse3 -endef - -define $(package)_stage_cmds - cd src/runtime && \ - cp -a runtime-fuse3 $($(package)_staging_prefix_dir)/runtime -endef \ No newline at end of file diff --git a/contrib/depends/packages/libfuse.mk b/contrib/depends/packages/libfuse.mk deleted file mode 100644 index ab2a139..0000000 --- a/contrib/depends/packages/libfuse.mk +++ /dev/null @@ -1,32 +0,0 @@ -package=libfuse -$(package)_version=3.16.2 -$(package)_download_path=https://github.com/libfuse/libfuse/releases/download/fuse-$($(package)_version) -$(package)_file_name=fuse-$($(package)_version).tar.gz -$(package)_sha256_hash=f797055d9296b275e981f5f62d4e32e089614fc253d1ef2985851025b8a0ce87 -$(package)_patches=toolchain.txt mount.c.diff no-dlopen.patch set_fusermount_path.patch - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/set_fusermount_path.patch && \ - patch -p1 < $($(package)_patch_dir)/no-dlopen.patch && \ - patch -p1 < $($(package)_patch_dir)/mount.c.diff && \ - cp $($(package)_patch_dir)/toolchain.txt toolchain.txt && \ - sed -i -e 's|@host_prefix@|$(host_prefix)|' \ - -e 's|@cc@|$($(package)_cc)|' \ - -e 's|@cxx@|$($(package)_cxx)|' \ - -e 's|@ar@|$($(package)_ar)|' \ - -e 's|@strip@|$(host_STRIP)|' \ - -e 's|@arch@|$(host_arch)|' \ - toolchain.txt -endef - -define $(package)_config_cmds - meson setup --cross-file toolchain.txt build -endef - -define $(package)_build_cmds - ninja -C build -endef - -define $(package)_stage_cmds - DESTDIR=$($(package)_staging_dir) ninja -C build install -endef diff --git a/contrib/depends/packages/libsquashfuse.mk b/contrib/depends/packages/libsquashfuse.mk deleted file mode 100644 index 84d9b5e..0000000 --- a/contrib/depends/packages/libsquashfuse.mk +++ /dev/null @@ -1,28 +0,0 @@ -package=libsquashfuse -$(package)_version=e51978cd6bb5c4d16fae9eee43d0b258f570bb0f -$(package)_download_path=https://github.com/vasi/squashfuse/archive/ -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=f544029ad30d8fbde4e4540c574b8cdc6d38b94df025a98d8551a9441f07d341 -$(package)_dependencies=libfuse zstd - -define $(package)_preprocess_cmds - ./autogen.sh -endef - -define $(package)_config_cmds - $($(package)_autoconf) --with-zstd=$(host_prefix) --without-zlib CFLAGS=-no-pie LDFLAGS=-static -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ - mkdir -p $($(package)_staging_prefix_dir)/lib && \ - mkdir -p $($(package)_staging_prefix_dir)/include/squashfuse && \ - cp .libs/libfuseprivate.a $($(package)_staging_prefix_dir)/lib/ && \ - cp .libs/libsquashfuse.a $($(package)_staging_prefix_dir)/lib/ && \ - cp .libs/libsquashfuse_ll.a $($(package)_staging_prefix_dir)/lib/ && \ - find . -name "*.h" -exec cp --parents '{}' $($(package)_staging_prefix_dir)/include/squashfuse \; -endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index 174a3b9..ce9a908 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -1,7 +1,7 @@ packages := boost openssl unbound qrencode libsodium polyseed hidapi abseil protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp native_packages := native_qt native_abseil native_protobuf -linux_packages := eudev libfuse libsquashfuse zstd appimage_runtime +linux_packages := eudev linux_native_packages = x86_64_linux_packages := flatstart diff --git a/contrib/depends/packages/zstd.mk b/contrib/depends/packages/zstd.mk deleted file mode 100644 index f7d25ad..0000000 --- a/contrib/depends/packages/zstd.mk +++ /dev/null @@ -1,16 +0,0 @@ -package=zstd -$(package)_version=1.5.6 -$(package)_download_path=https://github.com/facebook/zstd/releases/download/v$($(package)_version) -$(package)_file_name=zstd-$($(package)_version).tar.gz -$(package)_sha256_hash=8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1 - -define $(package)_build_cmds - $($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DHOST=$(host) -DZSTD_LEGACY_SUPPORT=OFF -B build-cmake-debug -S build/cmake && \ - cd build-cmake-debug && \ - $(MAKE) -endef - -define $(package)_stage_cmds - cd build-cmake-debug && \ - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/contrib/depends/patches/appimage_runtime/depends-fix.patch b/contrib/depends/patches/appimage_runtime/depends-fix.patch deleted file mode 100644 index c1fabed..0000000 --- a/contrib/depends/patches/appimage_runtime/depends-fix.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/src/runtime/Makefile b/src/runtime/Makefile -index d0cbf1f..905b130 100644 ---- a/src/runtime/Makefile -+++ b/src/runtime/Makefile -@@ -1,21 +1,21 @@ - CC = gcc - CFLAGS = -std=gnu99 -s -Os -D_FILE_OFFSET_BITS=64 -DGIT_COMMIT=\"${GIT_COMMIT}\" -T data_sections.ld -ffunction-sections -fdata-sections -Wl,--gc-sections -static --LIBS = -lsquashfuse -lsquashfuse_ll -lzstd -lz -+LIBS = -lsquashfuse -lsquashfuse_ll -lzstd -lpthread - - all: runtime-fuse3 runtime-fuse3 - - # Compile runtime - runtime-fuse3.o: runtime.c -- $(CC) -I/usr/local/include/squashfuse -I/usr/include/fuse -o runtime-fuse3.o -c $(CFLAGS) $^ -+ $(CC) -I${host_prefix}/include -I${host_prefix}/include/squashfuse -I${host_prefix}/include/fuse -o runtime-fuse3.o -c $(CFLAGS) $^ - - runtime-fuse3: runtime-fuse3.o - $(CC) $(CFLAGS) $^ $(LIBS) -lfuse -o runtime-fuse3 - - runtime-fuse3.o: runtime.c -- $(CC) -I/usr/local/include/squashfuse -I/usr/include/fuse3 -o runtime-fuse3.o -c $(CFLAGS) $^ -+ $(CC) -I${host_prefix}/include -I${host_prefix}/include/squashfuse -I${host_prefix}/include/fuse3 -o runtime-fuse3.o -c $(CFLAGS) $^ - - runtime-fuse3: runtime-fuse3.o -- $(CC) $(CFLAGS) $^ $(LIBS) -lfuse3 -o runtime-fuse3 -+ $(CC) $(CFLAGS) $^ -L${host_prefix}/lib $(LIBS) -lfuse3 -lpthread -o runtime-fuse3 - - clean: - rm -f *.o runtime-fuse3 runtime-fuse3 diff --git a/contrib/depends/patches/libfuse/mount.c.diff b/contrib/depends/patches/libfuse/mount.c.diff deleted file mode 100644 index 6835e61..0000000 --- a/contrib/depends/patches/libfuse/mount.c.diff +++ /dev/null @@ -1,139 +0,0 @@ -diff --git a/lib/mount.c b/lib/mount.c -index d71e6fc..e9c2ff0 100644 ---- a/lib/mount.c -+++ b/lib/mount.c -@@ -41,7 +41,6 @@ - #define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0) - #endif - --#define FUSERMOUNT_PROG "fusermount3" - #define FUSE_COMMFD_ENV "_FUSE_COMMFD" - - #ifndef HAVE_FORK -@@ -117,17 +116,87 @@ static const struct fuse_opt fuse_mount_opts[] = { - FUSE_OPT_END - }; - -+int fileExists(const char* path); -+char* findBinaryInFusermountDir(const char* binaryName); -+ -+int fileExists(const char* path) { -+ FILE* file = fopen(path, "r"); -+ if (file) { -+ fclose(file); -+ return 1; -+ } -+ return 0; -+} -+ -+char* findBinaryInFusermountDir(const char* binaryName) { -+ // For security reasons, we do not search the binary on the $PATH; -+ // instead, we check if the binary exists in FUSERMOUNT_DIR -+ // as defined in meson.build -+ char* binaryPath = malloc(strlen(FUSERMOUNT_DIR) + strlen(binaryName) + 2); -+ strcpy(binaryPath, FUSERMOUNT_DIR); -+ strcat(binaryPath, "/"); -+ strcat(binaryPath, binaryName); -+ if (fileExists(binaryPath)) { -+ return binaryPath; -+ } -+ -+ // Debian, Ubuntu -+ char* binaryPath2 = malloc(strlen(binaryName) + 6); -+ strcat(binaryPath2, "/bin/"); -+ strcat(binaryPath2, binaryName); -+ if (fileExists(binaryPath2)) { -+ return binaryPath2; -+ } -+ -+ // If the binary does not exist in FUSERMOUNT_DIR, return NULL -+ return NULL; -+} -+ -+static const char *fuse_mount_prog(void) -+{ -+ // Check if the FUSERMOUNT_PROG environment variable is set and if so, use it -+ const char *prog = getenv("FUSERMOUNT_PROG"); -+ if (prog) { -+ if (access(prog, X_OK) == 0) -+ return prog; -+ } -+ -+ // Check if there is a binary "fusermount3" -+ prog = findBinaryInFusermountDir("fusermount3"); -+ if (access(prog, X_OK) == 0) -+ return prog; -+ -+ // Check if there is a binary called "fusermount" -+ // This is known to work for our purposes -+ prog = findBinaryInFusermountDir("fusermount"); -+ if (access(prog, X_OK) == 0) -+ return prog; -+ -+ // For i = 4...99, check if there is a binary called "fusermount" + i -+ // It is not yet known whether this will work for our purposes, but it is better than not even attempting -+ for (int i = 4; i < 100; i++) { -+ prog = findBinaryInFusermountDir("fusermount" + i); -+ if (access(prog, X_OK) == 0) -+ return prog; -+ } -+ -+ // If all else fails, return NULL -+ return NULL; -+} -+ - static void exec_fusermount(const char *argv[]) - { -- execv(FUSERMOUNT_DIR "/" FUSERMOUNT_PROG, (char **) argv); -- execvp(FUSERMOUNT_PROG, (char **) argv); -+ const char *fusermount_prog = fuse_mount_prog(); -+ if (fusermount_prog) { -+ execv(fusermount_prog, (char **) argv); -+ } - } - - void fuse_mount_version(void) - { - int pid = fork(); - if (!pid) { -- const char *argv[] = { FUSERMOUNT_PROG, "--version", NULL }; -+ const char *argv[] = { fuse_mount_prog(), "--version", NULL }; - exec_fusermount(argv); - _exit(1); - } else if (pid != -1) -@@ -300,7 +369,7 @@ void fuse_kern_unmount(const char *mountpoint, int fd) - return; - - if(pid == 0) { -- const char *argv[] = { FUSERMOUNT_PROG, "-u", "-q", "-z", -+ const char *argv[] = { fuse_mount_prog(), "-u", "-q", "-z", - "--", mountpoint, NULL }; - - exec_fusermount(argv); -@@ -346,7 +415,7 @@ static int setup_auto_unmount(const char *mountpoint, int quiet) - } - } - -- argv[a++] = FUSERMOUNT_PROG; -+ argv[a++] = fuse_mount_prog(); - argv[a++] = "--auto-unmount"; - argv[a++] = "--"; - argv[a++] = mountpoint; -@@ -407,7 +476,7 @@ static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo, - } - } - -- argv[a++] = FUSERMOUNT_PROG; -+ argv[a++] = fuse_mount_prog(); - if (opts) { - argv[a++] = "-o"; - argv[a++] = opts; -@@ -421,7 +490,7 @@ static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo, - snprintf(env, sizeof(env), "%i", fds[0]); - setenv(FUSE_COMMFD_ENV, env, 1); - exec_fusermount(argv); -- perror("fuse: failed to exec fusermount3"); -+ perror("fuse: failed to exec fusermount"); - _exit(1); - } - diff --git a/contrib/depends/patches/libfuse/no-dlopen.patch b/contrib/depends/patches/libfuse/no-dlopen.patch deleted file mode 100644 index 93bf3bb..0000000 --- a/contrib/depends/patches/libfuse/no-dlopen.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/lib/fuse.c b/lib/fuse.c -index 2a88918..34a46c3 100644 ---- a/lib/fuse.c -+++ b/lib/fuse.c -@@ -242,50 +242,7 @@ static void fuse_unregister_module(struct fuse_module *m) - - static int fuse_load_so_module(const char *module) - { -- int ret = -1; -- char *tmp; -- struct fusemod_so *so; -- fuse_module_factory_t *factory; -- -- tmp = malloc(strlen(module) + 64); -- if (!tmp) { -- fuse_log(FUSE_LOG_ERR, "fuse: memory allocation failed\n"); -- return -1; -- } -- sprintf(tmp, "libfusemod_%s.so", module); -- so = calloc(1, sizeof(struct fusemod_so)); -- if (!so) { -- fuse_log(FUSE_LOG_ERR, "fuse: failed to allocate module so\n"); -- goto out; -- } -- -- so->handle = dlopen(tmp, RTLD_NOW); -- if (so->handle == NULL) { -- fuse_log(FUSE_LOG_ERR, "fuse: dlopen(%s) failed: %s\n", -- tmp, dlerror()); -- goto out_free_so; -- } -- -- sprintf(tmp, "fuse_module_%s_factory", module); -- factory = (fuse_module_factory_t*)dlsym(so->handle, tmp); -- if (factory == NULL) { -- fuse_log(FUSE_LOG_ERR, "fuse: symbol <%s> not found in module: %s\n", -- tmp, dlerror()); -- goto out_dlclose; -- } -- ret = fuse_register_module(module, *factory, so); -- if (ret) -- goto out_dlclose; -- --out: -- free(tmp); -- return ret; -- --out_dlclose: -- dlclose(so->handle); --out_free_so: -- free(so); -- goto out; -+ return -1; - } - - static struct fuse_module *fuse_find_module(const char *module) -@@ -335,7 +292,6 @@ static void fuse_put_module(struct fuse_module *m) - else - mp = &(*mp)->next; - } -- dlclose(so->handle); - free(so); - } - } else if (!m->ctr) { diff --git a/contrib/depends/patches/libfuse/set_fusermount_path.patch b/contrib/depends/patches/libfuse/set_fusermount_path.patch deleted file mode 100644 index f15725c..0000000 --- a/contrib/depends/patches/libfuse/set_fusermount_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/meson.build b/lib/meson.build -index 9044630..ea09d45 100644 ---- a/lib/meson.build -+++ b/lib/meson.build -@@ -32,7 +32,7 @@ else - deps += cc.find_library('rt') - endif - --fusermount_path = join_paths(get_option('prefix'), get_option('bindir')) -+fusermount_path = '/usr/bin' - libfuse = library('fuse3', libfuse_sources, version: meson.project_version(), - soversion: '3', include_directories: include_dirs, - dependencies: deps, install: true, diff --git a/contrib/depends/patches/libfuse/toolchain.txt b/contrib/depends/patches/libfuse/toolchain.txt deleted file mode 100644 index c65a94e..0000000 --- a/contrib/depends/patches/libfuse/toolchain.txt +++ /dev/null @@ -1,20 +0,0 @@ -[binaries] -c = '@cc@' -cpp = '@cxx@' -ar = '@ar@' -strip = '@strip@' -pkgconfig = '/home/user/.guix-profile/bin/pkg-config' - -[host_machine] -system = 'linux' -cpu_family = '@arch@' -cpu = '@arch@' -endian = 'little' - -[project options] -utils = false -examples = false - -[built-in options] -default_library = 'static' -prefix = '@host_prefix@' \ No newline at end of file diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index 0834d2c..4b99891 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -3,7 +3,12 @@ SET(CMAKE_SYSTEM_NAME @depends@) SET(CMAKE_SYSTEM_PROCESSOR @arch@) SET(CMAKE_BUILD_TYPE @release_type@) +OPTION(STATIC "Link libraries statically" ON) +OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF) +OPTION(BUILD_TESTS "Build tests." OFF) + SET(STATIC ON) +SET(UNBOUND_STATIC ON) SET(ARCH "default") SET(BUILD_TESTS @build_tests@) @@ -38,9 +43,17 @@ SET(absl_ROOT @prefix@) SET(NATIVE_BIN_PATH @prefix@/native/bin CACHE FILEPATH "path to native binaries" FORCE) SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE) +if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") +SET(LIBUNWIND_INCLUDE_DIR @prefix@/include) +SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a) +SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib) + if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") SET(LIBUSB-1.0_LIBRARY @prefix@/lib/libusb-1.0.a) SET(LIBUDEV_LIBRARY @prefix@/lib/libudev.a) + +endif() + endif() SET(ZMQ_INCLUDE_PATH @prefix@/include) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index c434208..ec0fd3c 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -374,12 +374,16 @@ mkdir -p "$DISTSRC" ;; esac + # We no longer ship 'real' AppImages + # The .AppImage extension is just there to trick file managers into allowing right click -> open. case "$HOST" in + riscv64-linux*) + ;; *linux*) + upx build/bin/feather -o build/bin/feather.upx if [ "$OPTIONS" != "pack" ]; then - bash contrib/AppImage/build-appimage.sh APPIMAGENAME=${DISTNAME}${ANONDIST}${LINUX_ARCH}.AppImage - mv feather.AppImage "${APPIMAGENAME}" + cp build/bin/feather.upx "${APPIMAGENAME}" cp "${APPIMAGENAME}" "${INSTALLPATH}/" cp "${APPIMAGENAME}" "${OUTDIR}/" fi diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index e3b8415..2fdab5d 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -284,6 +284,7 @@ chain for " target " development.")) p7zip zip unzip + upx ;; Build tools gnu-make libtool From c355370c0f059ee5bedfd22b23e581cacbbb5a6c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 6 Oct 2024 21:14:33 +0200 Subject: [PATCH 54/76] guix: fix riscv64 builds, remove squashfs-tools --- contrib/guix/libexec/build.sh | 18 ++++++++++++------ contrib/guix/manifest.scm | 1 - 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index ec0fd3c..1ad3e8a 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -477,12 +477,18 @@ mkdir -p "$DISTSRC" || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}${ANONDIST}.zip" && exit 1 ) ;; esac - find . -name "*.AppImage" -print0 \ - | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" - find . -name "*.AppImage" \ - | sort \ - | zip -X@ "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" && exit 1 ) + case "$HOST" in + riscv64-*) + ;; + *) + find . -name "*.AppImage" -print0 \ + | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" + find . -name "*.AppImage" \ + | sort \ + | zip -X@ "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" && exit 1 ) + ;; + esac else find . -print0 \ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 2fdab5d..76fb534 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -294,7 +294,6 @@ chain for " target " development.")) bison gperf gettext-minimal - squashfs-tools cmake-minimal meson ninja From 9a37d4789fc1708b61504e87df289d97ecb3677c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 6 Oct 2024 22:43:37 +0200 Subject: [PATCH 55/76] wallet: show notification on mining payment --- monero | 2 +- src/MainWindow.cpp | 6 ++++++ src/libwalletqt/Wallet.h | 2 +- src/libwalletqt/WalletListenerImpl.cpp | 4 ++-- src/libwalletqt/WalletListenerImpl.h | 2 +- src/libwalletqt/WalletManager.cpp | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/monero b/monero index d50ba72..ed8e0d1 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit d50ba728d79cc3a96c928f7736503268ad567cba +Subproject commit ed8e0d19519f7fe50d0a8acc203e7d39c2aefbbc diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index b3d9189..882a061 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -485,6 +485,12 @@ void MainWindow::initWalletContext() { m_windowManager->notify("Payment received", notify, 5000); } }); + connect(m_wallet, &Wallet::moneyReceived, this, [this](const QString &txId, uint64_t amount, bool coinbase){ + if (m_wallet->isSynchronized() && !m_locked && coinbase) { + auto notify = QString("%1 XMR").arg(WalletManager::displayAmount(amount, false)); + m_windowManager->notify("Mining payment received", notify, 5000); + } + }); // Device connect(m_wallet, &Wallet::deviceButtonRequest, this, &MainWindow::onDeviceButtonRequest); diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 2da7baf..8d64760 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -435,7 +435,7 @@ signals: void refreshed(bool success, const QString &message); void moneySpent(const QString &txId, quint64 amount); - void moneyReceived(const QString &txId, quint64 amount); + void moneyReceived(const QString &txId, quint64 amount, bool coinbase); void unconfirmedMoneyReceived(const QString &txId, quint64 amount); void newBlock(quint64 height, quint64 targetHeight); void walletCreationHeightChanged(); diff --git a/src/libwalletqt/WalletListenerImpl.cpp b/src/libwalletqt/WalletListenerImpl.cpp index 2f62589..ff32efb 100644 --- a/src/libwalletqt/WalletListenerImpl.cpp +++ b/src/libwalletqt/WalletListenerImpl.cpp @@ -25,13 +25,13 @@ void WalletListenerImpl::moneySpent(const std::string &txId, uint64_t amount) emit m_wallet->moneySpent(qTxId, amount); } -void WalletListenerImpl::moneyReceived(const std::string &txId, uint64_t amount) +void WalletListenerImpl::moneyReceived(const std::string &txId, uint64_t amount, bool coinbase) { // Incoming tx included in a block. QString qTxId = QString::fromStdString(txId); qDebug() << Q_FUNC_INFO << qTxId << " " << WalletManager::displayAmount(amount); - emit m_wallet->moneyReceived(qTxId, amount); + emit m_wallet->moneyReceived(qTxId, amount, coinbase); } void WalletListenerImpl::unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) diff --git a/src/libwalletqt/WalletListenerImpl.h b/src/libwalletqt/WalletListenerImpl.h index da0ba11..a2a60ef 100644 --- a/src/libwalletqt/WalletListenerImpl.h +++ b/src/libwalletqt/WalletListenerImpl.h @@ -16,7 +16,7 @@ public: virtual void moneySpent(const std::string &txId, uint64_t amount) override; - virtual void moneyReceived(const std::string &txId, uint64_t amount) override; + virtual void moneyReceived(const std::string &txId, uint64_t amount, bool coinbase) override; virtual void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) override; diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 92ffe8a..c88f014 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -13,7 +13,7 @@ public: explicit WalletPassphraseListenerImpl(WalletManager * mgr): m_mgr(mgr), m_phelper(mgr) {} void moneySpent(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; }; - void moneyReceived(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; }; + void moneyReceived(const std::string &txId, uint64_t amount, bool coinbase) override { (void)txId; (void)amount; (void)coinbase;}; void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) override { (void)txId; (void)amount; }; void newBlock(uint64_t height) override { (void) height; }; void updated() override {}; From e350af3492f5d05fdc2b3338ac7e0cb72e75bd11 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 6 Oct 2024 23:47:41 +0200 Subject: [PATCH 56/76] windowmanager: improve error message if cache file can't be read --- monero | 2 +- src/WindowManager.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/monero b/monero index ed8e0d1..55a6b00 160000 --- a/monero +++ b/monero @@ -1 +1 @@ -Subproject commit ed8e0d19519f7fe50d0a8acc203e7d39c2aefbbc +Subproject commit 55a6b0018bb61abb9985a3054837d48f4d1020d8 diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index dbd022a..a34eae9 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -290,7 +290,16 @@ void WindowManager::onWalletOpened(Wallet *wallet) { WalletManager::clearWalletCache(wallet->cachePath()); errMsg = QString("%1\n\nWallet cache is unusable, moving it.").arg(errMsg); this->handleWalletError({nullptr, Utils::ERROR, "Unable to open wallet", errMsg, {"Try opening this wallet again.", "If this keeps happening, please file a bug report."}, "report_an_issue"}); - } else { + } + else if (errMsg.startsWith("failed to read file")) { +#if defined(Q_OS_MACOS) + Utils::Message message{nullptr, Utils::ERROR, "Unable to open wallet", errMsg, {"You may need to give Feather permission to access the folder", "In the System Settings app, go to 'Privacy & Security' -> 'Files & Folders'"}}; +#else + Utils::Message message{nullptr, Utils::ERROR, "Unable to open wallet", errMsg, {"You may need to change the permissions on the wallet directory."}}; +#endif + this->handleWalletError(message); + } + else { Utils::Message message{nullptr, Utils::ERROR, "Unable to open wallet"}; this->handleDeviceError(errMsg, message); this->handleWalletError(message); From ec8d3bff57ece855552db616b50c6715ccd9d2e2 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 00:22:12 +0200 Subject: [PATCH 57/76] windowmanager: properly exit app on close if wallet failed to open --- src/WindowManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index a34eae9..48b5de1 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -284,6 +284,7 @@ void WindowManager::onWalletOpened(Wallet *wallet) { bool showIncorrectPassword = m_openWalletTriedOnce; m_openWalletTriedOnce = true; this->onWalletOpenPasswordRequired(showIncorrectPassword, wallet->keysPath()); + return; // Do not remove this } else if (errMsg == QString("basic_string::_M_replace_aux") || errMsg == QString("std::bad_alloc") || errMsg == "invalid signature") { qCritical() << errMsg; @@ -304,6 +305,8 @@ void WindowManager::onWalletOpened(Wallet *wallet) { this->handleDeviceError(errMsg, message); this->handleWalletError(message); } + + m_openingWallet = false; return; } From c14333cdc3ff036f53b85311511165a8d9484d25 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 01:48:20 +0200 Subject: [PATCH 58/76] main: fix application name this is used for config path on windows and macos --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ed516db..b285482 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { Application app(argc, argv); - QApplication::setApplicationName("Feather"); + QApplication::setApplicationName("FeatherWallet"); QApplication::setApplicationVersion(FEATHER_VERSION); QCommandLineParser parser; From b7ef31610ed845202d3285cb250e7343b2922e00 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 04:25:22 +0200 Subject: [PATCH 59/76] Revert "build: replace AppImage runtime with UPX" --- contrib/AppImage/AppRun | 8 + contrib/AppImage/build-appimage.sh | 33 +++++ contrib/depends/packages/appimage_runtime.mk | 23 +++ contrib/depends/packages/libfuse.mk | 32 ++++ contrib/depends/packages/libsquashfuse.mk | 28 ++++ contrib/depends/packages/packages.mk | 2 +- contrib/depends/packages/zstd.mk | 16 ++ .../appimage_runtime/depends-fix.patch | 30 ++++ contrib/depends/patches/libfuse/mount.c.diff | 139 ++++++++++++++++++ .../depends/patches/libfuse/no-dlopen.patch | 64 ++++++++ .../patches/libfuse/set_fusermount_path.patch | 13 ++ contrib/depends/patches/libfuse/toolchain.txt | 20 +++ contrib/guix/libexec/build.sh | 26 +--- contrib/guix/manifest.scm | 2 +- 14 files changed, 416 insertions(+), 20 deletions(-) create mode 100644 contrib/AppImage/AppRun create mode 100755 contrib/AppImage/build-appimage.sh create mode 100644 contrib/depends/packages/appimage_runtime.mk create mode 100644 contrib/depends/packages/libfuse.mk create mode 100644 contrib/depends/packages/libsquashfuse.mk create mode 100644 contrib/depends/packages/zstd.mk create mode 100644 contrib/depends/patches/appimage_runtime/depends-fix.patch create mode 100644 contrib/depends/patches/libfuse/mount.c.diff create mode 100644 contrib/depends/patches/libfuse/no-dlopen.patch create mode 100644 contrib/depends/patches/libfuse/set_fusermount_path.patch create mode 100644 contrib/depends/patches/libfuse/toolchain.txt diff --git a/contrib/AppImage/AppRun b/contrib/AppImage/AppRun new file mode 100644 index 0000000..dc50855 --- /dev/null +++ b/contrib/AppImage/AppRun @@ -0,0 +1,8 @@ +#!/bin/bash + +HERE="$(dirname "$(readlink -f "${0}")")" +echo $HERE + +# Tails 5.8 sets QT_QPA_PLATFORM to wayland which breaks our app +export QT_QPA_PLATFORM=xcb +${APPDIR}/usr/bin/feather $* diff --git a/contrib/AppImage/build-appimage.sh b/contrib/AppImage/build-appimage.sh new file mode 100755 index 0000000..750ecf8 --- /dev/null +++ b/contrib/AppImage/build-appimage.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e +unset SOURCE_DATE_EPOCH + +# Manually create the AppImage (reproducibly) since linuxdeployqt is not able to create cross-compiled AppImages + +APPDIR="$PWD/feather.AppDir" + +mkdir -p "$APPDIR" +mkdir -p "$APPDIR/usr/share/applications/" +mkdir -p "$APPDIR/usr/bin" + +cp "src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop" +cp "src/assets/feather.desktop" "$APPDIR/feather.desktop" +cp "src/assets/images/appicons/64x64.png" "$APPDIR/feather.png" +cp "build/bin/feather" "$APPDIR/usr/bin/feather" +chmod +x "$APPDIR/usr/bin/feather" + +cp "contrib/AppImage/AppRun" "$APPDIR/" +chmod +x "$APPDIR/AppRun" + +find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \; + +mksquashfs feather.AppDir feather.squashfs -comp zstd -info -root-owned -no-xattrs -noappend -fstime 0 +# mksquashfs writes a timestamp to the header +printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8)) + +rm -f feather.AppImage + +cat /feather/contrib/depends/${HOST}/runtime >> feather.AppImage +cat feather.squashfs >> feather.AppImage +chmod a+x feather.AppImage diff --git a/contrib/depends/packages/appimage_runtime.mk b/contrib/depends/packages/appimage_runtime.mk new file mode 100644 index 0000000..6077de2 --- /dev/null +++ b/contrib/depends/packages/appimage_runtime.mk @@ -0,0 +1,23 @@ +package=appimage_runtime +$(package)_version=c9553b05938b22849ac3255ac923bf8e775ce539 +$(package)_download_path=https://github.com/AppImage/type2-runtime/archive/ +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=4a27451013b571cf9f5a13660719d091cc79f2344aafa2e48578ddc0e4618af1 +$(package)_dependencies=libsquashfuse zstd +$(package)_patches=depends-fix.patch + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/depends-fix.patch +endef + +define $(package)_build_cmds + cd src/runtime && \ + export host_prefix="$(host_prefix)" && \ + $(MAKE) runtime-fuse3 -e CC=$($(package)_cc) LDLAGS="$($(package)_ldflags)" && \ + "${HOST}-strip" runtime-fuse3 +endef + +define $(package)_stage_cmds + cd src/runtime && \ + cp -a runtime-fuse3 $($(package)_staging_prefix_dir)/runtime +endef \ No newline at end of file diff --git a/contrib/depends/packages/libfuse.mk b/contrib/depends/packages/libfuse.mk new file mode 100644 index 0000000..ab2a139 --- /dev/null +++ b/contrib/depends/packages/libfuse.mk @@ -0,0 +1,32 @@ +package=libfuse +$(package)_version=3.16.2 +$(package)_download_path=https://github.com/libfuse/libfuse/releases/download/fuse-$($(package)_version) +$(package)_file_name=fuse-$($(package)_version).tar.gz +$(package)_sha256_hash=f797055d9296b275e981f5f62d4e32e089614fc253d1ef2985851025b8a0ce87 +$(package)_patches=toolchain.txt mount.c.diff no-dlopen.patch set_fusermount_path.patch + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/set_fusermount_path.patch && \ + patch -p1 < $($(package)_patch_dir)/no-dlopen.patch && \ + patch -p1 < $($(package)_patch_dir)/mount.c.diff && \ + cp $($(package)_patch_dir)/toolchain.txt toolchain.txt && \ + sed -i -e 's|@host_prefix@|$(host_prefix)|' \ + -e 's|@cc@|$($(package)_cc)|' \ + -e 's|@cxx@|$($(package)_cxx)|' \ + -e 's|@ar@|$($(package)_ar)|' \ + -e 's|@strip@|$(host_STRIP)|' \ + -e 's|@arch@|$(host_arch)|' \ + toolchain.txt +endef + +define $(package)_config_cmds + meson setup --cross-file toolchain.txt build +endef + +define $(package)_build_cmds + ninja -C build +endef + +define $(package)_stage_cmds + DESTDIR=$($(package)_staging_dir) ninja -C build install +endef diff --git a/contrib/depends/packages/libsquashfuse.mk b/contrib/depends/packages/libsquashfuse.mk new file mode 100644 index 0000000..84d9b5e --- /dev/null +++ b/contrib/depends/packages/libsquashfuse.mk @@ -0,0 +1,28 @@ +package=libsquashfuse +$(package)_version=e51978cd6bb5c4d16fae9eee43d0b258f570bb0f +$(package)_download_path=https://github.com/vasi/squashfuse/archive/ +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=f544029ad30d8fbde4e4540c574b8cdc6d38b94df025a98d8551a9441f07d341 +$(package)_dependencies=libfuse zstd + +define $(package)_preprocess_cmds + ./autogen.sh +endef + +define $(package)_config_cmds + $($(package)_autoconf) --with-zstd=$(host_prefix) --without-zlib CFLAGS=-no-pie LDFLAGS=-static +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ + mkdir -p $($(package)_staging_prefix_dir)/lib && \ + mkdir -p $($(package)_staging_prefix_dir)/include/squashfuse && \ + cp .libs/libfuseprivate.a $($(package)_staging_prefix_dir)/lib/ && \ + cp .libs/libsquashfuse.a $($(package)_staging_prefix_dir)/lib/ && \ + cp .libs/libsquashfuse_ll.a $($(package)_staging_prefix_dir)/lib/ && \ + find . -name "*.h" -exec cp --parents '{}' $($(package)_staging_prefix_dir)/include/squashfuse \; +endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index ce9a908..174a3b9 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -1,7 +1,7 @@ packages := boost openssl unbound qrencode libsodium polyseed hidapi abseil protobuf libusb zlib libgpg-error libgcrypt expat libzip zxing-cpp native_packages := native_qt native_abseil native_protobuf -linux_packages := eudev +linux_packages := eudev libfuse libsquashfuse zstd appimage_runtime linux_native_packages = x86_64_linux_packages := flatstart diff --git a/contrib/depends/packages/zstd.mk b/contrib/depends/packages/zstd.mk new file mode 100644 index 0000000..f7d25ad --- /dev/null +++ b/contrib/depends/packages/zstd.mk @@ -0,0 +1,16 @@ +package=zstd +$(package)_version=1.5.6 +$(package)_download_path=https://github.com/facebook/zstd/releases/download/v$($(package)_version) +$(package)_file_name=zstd-$($(package)_version).tar.gz +$(package)_sha256_hash=8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1 + +define $(package)_build_cmds + $($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DHOST=$(host) -DZSTD_LEGACY_SUPPORT=OFF -B build-cmake-debug -S build/cmake && \ + cd build-cmake-debug && \ + $(MAKE) +endef + +define $(package)_stage_cmds + cd build-cmake-debug && \ + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/patches/appimage_runtime/depends-fix.patch b/contrib/depends/patches/appimage_runtime/depends-fix.patch new file mode 100644 index 0000000..c1fabed --- /dev/null +++ b/contrib/depends/patches/appimage_runtime/depends-fix.patch @@ -0,0 +1,30 @@ +diff --git a/src/runtime/Makefile b/src/runtime/Makefile +index d0cbf1f..905b130 100644 +--- a/src/runtime/Makefile ++++ b/src/runtime/Makefile +@@ -1,21 +1,21 @@ + CC = gcc + CFLAGS = -std=gnu99 -s -Os -D_FILE_OFFSET_BITS=64 -DGIT_COMMIT=\"${GIT_COMMIT}\" -T data_sections.ld -ffunction-sections -fdata-sections -Wl,--gc-sections -static +-LIBS = -lsquashfuse -lsquashfuse_ll -lzstd -lz ++LIBS = -lsquashfuse -lsquashfuse_ll -lzstd -lpthread + + all: runtime-fuse3 runtime-fuse3 + + # Compile runtime + runtime-fuse3.o: runtime.c +- $(CC) -I/usr/local/include/squashfuse -I/usr/include/fuse -o runtime-fuse3.o -c $(CFLAGS) $^ ++ $(CC) -I${host_prefix}/include -I${host_prefix}/include/squashfuse -I${host_prefix}/include/fuse -o runtime-fuse3.o -c $(CFLAGS) $^ + + runtime-fuse3: runtime-fuse3.o + $(CC) $(CFLAGS) $^ $(LIBS) -lfuse -o runtime-fuse3 + + runtime-fuse3.o: runtime.c +- $(CC) -I/usr/local/include/squashfuse -I/usr/include/fuse3 -o runtime-fuse3.o -c $(CFLAGS) $^ ++ $(CC) -I${host_prefix}/include -I${host_prefix}/include/squashfuse -I${host_prefix}/include/fuse3 -o runtime-fuse3.o -c $(CFLAGS) $^ + + runtime-fuse3: runtime-fuse3.o +- $(CC) $(CFLAGS) $^ $(LIBS) -lfuse3 -o runtime-fuse3 ++ $(CC) $(CFLAGS) $^ -L${host_prefix}/lib $(LIBS) -lfuse3 -lpthread -o runtime-fuse3 + + clean: + rm -f *.o runtime-fuse3 runtime-fuse3 diff --git a/contrib/depends/patches/libfuse/mount.c.diff b/contrib/depends/patches/libfuse/mount.c.diff new file mode 100644 index 0000000..6835e61 --- /dev/null +++ b/contrib/depends/patches/libfuse/mount.c.diff @@ -0,0 +1,139 @@ +diff --git a/lib/mount.c b/lib/mount.c +index d71e6fc..e9c2ff0 100644 +--- a/lib/mount.c ++++ b/lib/mount.c +@@ -41,7 +41,6 @@ + #define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0) + #endif + +-#define FUSERMOUNT_PROG "fusermount3" + #define FUSE_COMMFD_ENV "_FUSE_COMMFD" + + #ifndef HAVE_FORK +@@ -117,17 +116,87 @@ static const struct fuse_opt fuse_mount_opts[] = { + FUSE_OPT_END + }; + ++int fileExists(const char* path); ++char* findBinaryInFusermountDir(const char* binaryName); ++ ++int fileExists(const char* path) { ++ FILE* file = fopen(path, "r"); ++ if (file) { ++ fclose(file); ++ return 1; ++ } ++ return 0; ++} ++ ++char* findBinaryInFusermountDir(const char* binaryName) { ++ // For security reasons, we do not search the binary on the $PATH; ++ // instead, we check if the binary exists in FUSERMOUNT_DIR ++ // as defined in meson.build ++ char* binaryPath = malloc(strlen(FUSERMOUNT_DIR) + strlen(binaryName) + 2); ++ strcpy(binaryPath, FUSERMOUNT_DIR); ++ strcat(binaryPath, "/"); ++ strcat(binaryPath, binaryName); ++ if (fileExists(binaryPath)) { ++ return binaryPath; ++ } ++ ++ // Debian, Ubuntu ++ char* binaryPath2 = malloc(strlen(binaryName) + 6); ++ strcat(binaryPath2, "/bin/"); ++ strcat(binaryPath2, binaryName); ++ if (fileExists(binaryPath2)) { ++ return binaryPath2; ++ } ++ ++ // If the binary does not exist in FUSERMOUNT_DIR, return NULL ++ return NULL; ++} ++ ++static const char *fuse_mount_prog(void) ++{ ++ // Check if the FUSERMOUNT_PROG environment variable is set and if so, use it ++ const char *prog = getenv("FUSERMOUNT_PROG"); ++ if (prog) { ++ if (access(prog, X_OK) == 0) ++ return prog; ++ } ++ ++ // Check if there is a binary "fusermount3" ++ prog = findBinaryInFusermountDir("fusermount3"); ++ if (access(prog, X_OK) == 0) ++ return prog; ++ ++ // Check if there is a binary called "fusermount" ++ // This is known to work for our purposes ++ prog = findBinaryInFusermountDir("fusermount"); ++ if (access(prog, X_OK) == 0) ++ return prog; ++ ++ // For i = 4...99, check if there is a binary called "fusermount" + i ++ // It is not yet known whether this will work for our purposes, but it is better than not even attempting ++ for (int i = 4; i < 100; i++) { ++ prog = findBinaryInFusermountDir("fusermount" + i); ++ if (access(prog, X_OK) == 0) ++ return prog; ++ } ++ ++ // If all else fails, return NULL ++ return NULL; ++} ++ + static void exec_fusermount(const char *argv[]) + { +- execv(FUSERMOUNT_DIR "/" FUSERMOUNT_PROG, (char **) argv); +- execvp(FUSERMOUNT_PROG, (char **) argv); ++ const char *fusermount_prog = fuse_mount_prog(); ++ if (fusermount_prog) { ++ execv(fusermount_prog, (char **) argv); ++ } + } + + void fuse_mount_version(void) + { + int pid = fork(); + if (!pid) { +- const char *argv[] = { FUSERMOUNT_PROG, "--version", NULL }; ++ const char *argv[] = { fuse_mount_prog(), "--version", NULL }; + exec_fusermount(argv); + _exit(1); + } else if (pid != -1) +@@ -300,7 +369,7 @@ void fuse_kern_unmount(const char *mountpoint, int fd) + return; + + if(pid == 0) { +- const char *argv[] = { FUSERMOUNT_PROG, "-u", "-q", "-z", ++ const char *argv[] = { fuse_mount_prog(), "-u", "-q", "-z", + "--", mountpoint, NULL }; + + exec_fusermount(argv); +@@ -346,7 +415,7 @@ static int setup_auto_unmount(const char *mountpoint, int quiet) + } + } + +- argv[a++] = FUSERMOUNT_PROG; ++ argv[a++] = fuse_mount_prog(); + argv[a++] = "--auto-unmount"; + argv[a++] = "--"; + argv[a++] = mountpoint; +@@ -407,7 +476,7 @@ static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo, + } + } + +- argv[a++] = FUSERMOUNT_PROG; ++ argv[a++] = fuse_mount_prog(); + if (opts) { + argv[a++] = "-o"; + argv[a++] = opts; +@@ -421,7 +490,7 @@ static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo, + snprintf(env, sizeof(env), "%i", fds[0]); + setenv(FUSE_COMMFD_ENV, env, 1); + exec_fusermount(argv); +- perror("fuse: failed to exec fusermount3"); ++ perror("fuse: failed to exec fusermount"); + _exit(1); + } + diff --git a/contrib/depends/patches/libfuse/no-dlopen.patch b/contrib/depends/patches/libfuse/no-dlopen.patch new file mode 100644 index 0000000..93bf3bb --- /dev/null +++ b/contrib/depends/patches/libfuse/no-dlopen.patch @@ -0,0 +1,64 @@ +diff --git a/lib/fuse.c b/lib/fuse.c +index 2a88918..34a46c3 100644 +--- a/lib/fuse.c ++++ b/lib/fuse.c +@@ -242,50 +242,7 @@ static void fuse_unregister_module(struct fuse_module *m) + + static int fuse_load_so_module(const char *module) + { +- int ret = -1; +- char *tmp; +- struct fusemod_so *so; +- fuse_module_factory_t *factory; +- +- tmp = malloc(strlen(module) + 64); +- if (!tmp) { +- fuse_log(FUSE_LOG_ERR, "fuse: memory allocation failed\n"); +- return -1; +- } +- sprintf(tmp, "libfusemod_%s.so", module); +- so = calloc(1, sizeof(struct fusemod_so)); +- if (!so) { +- fuse_log(FUSE_LOG_ERR, "fuse: failed to allocate module so\n"); +- goto out; +- } +- +- so->handle = dlopen(tmp, RTLD_NOW); +- if (so->handle == NULL) { +- fuse_log(FUSE_LOG_ERR, "fuse: dlopen(%s) failed: %s\n", +- tmp, dlerror()); +- goto out_free_so; +- } +- +- sprintf(tmp, "fuse_module_%s_factory", module); +- factory = (fuse_module_factory_t*)dlsym(so->handle, tmp); +- if (factory == NULL) { +- fuse_log(FUSE_LOG_ERR, "fuse: symbol <%s> not found in module: %s\n", +- tmp, dlerror()); +- goto out_dlclose; +- } +- ret = fuse_register_module(module, *factory, so); +- if (ret) +- goto out_dlclose; +- +-out: +- free(tmp); +- return ret; +- +-out_dlclose: +- dlclose(so->handle); +-out_free_so: +- free(so); +- goto out; ++ return -1; + } + + static struct fuse_module *fuse_find_module(const char *module) +@@ -335,7 +292,6 @@ static void fuse_put_module(struct fuse_module *m) + else + mp = &(*mp)->next; + } +- dlclose(so->handle); + free(so); + } + } else if (!m->ctr) { diff --git a/contrib/depends/patches/libfuse/set_fusermount_path.patch b/contrib/depends/patches/libfuse/set_fusermount_path.patch new file mode 100644 index 0000000..f15725c --- /dev/null +++ b/contrib/depends/patches/libfuse/set_fusermount_path.patch @@ -0,0 +1,13 @@ +diff --git a/lib/meson.build b/lib/meson.build +index 9044630..ea09d45 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -32,7 +32,7 @@ else + deps += cc.find_library('rt') + endif + +-fusermount_path = join_paths(get_option('prefix'), get_option('bindir')) ++fusermount_path = '/usr/bin' + libfuse = library('fuse3', libfuse_sources, version: meson.project_version(), + soversion: '3', include_directories: include_dirs, + dependencies: deps, install: true, diff --git a/contrib/depends/patches/libfuse/toolchain.txt b/contrib/depends/patches/libfuse/toolchain.txt new file mode 100644 index 0000000..c65a94e --- /dev/null +++ b/contrib/depends/patches/libfuse/toolchain.txt @@ -0,0 +1,20 @@ +[binaries] +c = '@cc@' +cpp = '@cxx@' +ar = '@ar@' +strip = '@strip@' +pkgconfig = '/home/user/.guix-profile/bin/pkg-config' + +[host_machine] +system = 'linux' +cpu_family = '@arch@' +cpu = '@arch@' +endian = 'little' + +[project options] +utils = false +examples = false + +[built-in options] +default_library = 'static' +prefix = '@host_prefix@' \ No newline at end of file diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 1ad3e8a..c434208 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -374,16 +374,12 @@ mkdir -p "$DISTSRC" ;; esac - # We no longer ship 'real' AppImages - # The .AppImage extension is just there to trick file managers into allowing right click -> open. case "$HOST" in - riscv64-linux*) - ;; *linux*) - upx build/bin/feather -o build/bin/feather.upx if [ "$OPTIONS" != "pack" ]; then + bash contrib/AppImage/build-appimage.sh APPIMAGENAME=${DISTNAME}${ANONDIST}${LINUX_ARCH}.AppImage - cp build/bin/feather.upx "${APPIMAGENAME}" + mv feather.AppImage "${APPIMAGENAME}" cp "${APPIMAGENAME}" "${INSTALLPATH}/" cp "${APPIMAGENAME}" "${OUTDIR}/" fi @@ -477,18 +473,12 @@ mkdir -p "$DISTSRC" || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}${ANONDIST}.zip" && exit 1 ) ;; esac - case "$HOST" in - riscv64-*) - ;; - *) - find . -name "*.AppImage" -print0 \ - | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" - find . -name "*.AppImage" \ - | sort \ - | zip -X@ "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" && exit 1 ) - ;; - esac + find . -name "*.AppImage" -print0 \ + | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" + find . -name "*.AppImage" \ + | sort \ + | zip -X@ "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-linux${LINUX_ARCH}-appimage${ANONDIST}.zip" && exit 1 ) else find . -print0 \ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 76fb534..e3b8415 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -284,7 +284,6 @@ chain for " target " development.")) p7zip zip unzip - upx ;; Build tools gnu-make libtool @@ -294,6 +293,7 @@ chain for " target " development.")) bison gperf gettext-minimal + squashfs-tools cmake-minimal meson ninja From 6aa661d7ba14ed677dccc53a0f591bd41622fc41 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 15:34:27 +0200 Subject: [PATCH 60/76] history: import descriptions from CSV --- src/MainWindow.cpp | 18 ++++- src/MainWindow.h | 1 + src/MainWindow.ui | 6 ++ src/libwalletqt/Coins.cpp | 2 + src/libwalletqt/TransactionHistory.cpp | 108 ++++++++++++++++++++++++- src/libwalletqt/TransactionHistory.h | 4 +- src/libwalletqt/Wallet.cpp | 4 - src/model/TransactionHistoryModel.cpp | 2 + src/model/TransactionHistoryModel.h | 1 + 9 files changed, 137 insertions(+), 9 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 882a061..324ea90 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -315,6 +315,7 @@ void MainWindow::initMenu() { // [Wallet] -> [History] connect(ui->actionExport_CSV, &QAction::triggered, this, &MainWindow::onExportHistoryCSV); + connect(ui->actionImportHistoryCSV, &QAction::triggered, this, &MainWindow::onImportHistoryDescriptionsCSV); // [Wallet] -> [Contacts] connect(ui->actionExportContactsCSV, &QAction::triggered, this, &MainWindow::onExportContactsCSV); @@ -575,7 +576,7 @@ void MainWindow::onWalletOpened() { m_wallet->history()->refresh(); }); // Vice versa - connect(m_wallet->history(), &TransactionHistory::txNoteChanged, [this] { + connect(m_wallet->transactionHistoryModel(), &TransactionHistoryModel::transactionDescriptionChanged, [this] { m_wallet->coins()->refresh(); }); @@ -1713,6 +1714,21 @@ void MainWindow::onExportHistoryCSV() { Utils::showInfo(this, "CSV export", QString("Transaction history exported to %1").arg(fn)); } +void MainWindow::onImportHistoryDescriptionsCSV() { + const QString fileName = QFileDialog::getOpenFileName(this, "Import CSV file", QDir::homePath(), "CSV Files (*.csv)"); + if (fileName.isEmpty()) { + return; + } + + QString error = m_wallet->history()->importLabelsFromCSV(fileName); + if (!error.isEmpty()) { + Utils::showError(this, "Unable to import transaction descriptions from CSV", error); + } + else { + Utils::showInfo(this, "Successfully imported transaction descriptions from CSV"); + } +} + void MainWindow::onExportContactsCSV() { auto *model = m_wallet->addressBookModel(); if (model->rowCount() <= 0){ diff --git a/src/MainWindow.h b/src/MainWindow.h index 9e15b0c..84cbe41 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -113,6 +113,7 @@ private slots: void menuToggleTabVisible(const QString &key); void menuClearHistoryClicked(); void onExportHistoryCSV(); + void onImportHistoryDescriptionsCSV(); void onExportContactsCSV(); void onCreateDesktopEntry(); void onShowDocumentation(); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 7cde519..1133416 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -499,6 +499,7 @@ History + @@ -939,6 +940,11 @@ Tx pool viewer + + + Import descriptions from CSV + + diff --git a/src/libwalletqt/Coins.cpp b/src/libwalletqt/Coins.cpp index 7ab8a45..c5de0aa 100644 --- a/src/libwalletqt/Coins.cpp +++ b/src/libwalletqt/Coins.cpp @@ -34,6 +34,8 @@ CoinsInfo* Coins::coin(int index) void Coins::refresh() { + qDebug() << Q_FUNC_INFO; + emit refreshStarted(); boost::shared_lock transfers_lock(m_wallet2->m_transfers_mutex); diff --git a/src/libwalletqt/TransactionHistory.cpp b/src/libwalletqt/TransactionHistory.cpp index 064352d..7102f3e 100644 --- a/src/libwalletqt/TransactionHistory.cpp +++ b/src/libwalletqt/TransactionHistory.cpp @@ -64,6 +64,8 @@ TransactionRow* TransactionHistory::transaction(int index) void TransactionHistory::refresh() { + qDebug() << Q_FUNC_INFO; + QDateTime firstDateTime = QDate(2014, 4, 18).startOfDay(); QDateTime lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones) @@ -281,12 +283,14 @@ void TransactionHistory::refresh() void TransactionHistory::setTxNote(const QString &txid, const QString ¬e) { cryptonote::blobdata txid_data; - if(!epee::string_tools::parse_hexstr_to_binbuff(txid.toStdString(), txid_data) || txid_data.size() != sizeof(crypto::hash)) + if (!epee::string_tools::parse_hexstr_to_binbuff(txid.toStdString(), txid_data) || txid_data.size() != sizeof(crypto::hash)) { + qDebug() << Q_FUNC_INFO << "invalid txid"; return; + } + const crypto::hash htxid = *reinterpret_cast(txid_data.data()); m_wallet2->set_tx_note(htxid, note.toStdString()); - refresh(); emit txNoteChanged(); } @@ -401,4 +405,102 @@ bool TransactionHistory::writeCSV(const QString &path) { data = QString("blockHeight,timestamp,date,accountIndex,direction,balanceDelta,amount,fee,txid,description,paymentId,fiatAmount,fiatCurrency%1").arg(data); return Utils::fileWrite(path, data); -} \ No newline at end of file +} + +QStringList parseCSVLine(const QString &line) { + QStringList result; + QString currentField; + bool inQuotes = false; + + for (int i = 0; i < line.length(); ++i) { + QChar currentChar = line[i]; + + if (currentChar == '"') { + if (inQuotes && i + 1 < line.length() && line[i + 1] == '"') { + currentField.append('"'); + ++i; + } else { + inQuotes = !inQuotes; + } + } else if (currentChar == ',' && !inQuotes) { + result.append(currentField.trimmed()); + currentField.clear(); + } else { + currentField.append(currentChar); + } + } + + result.append(currentField.trimmed()); + return result; +} + +QString TransactionHistory::importLabelsFromCSV(const QString &fileName) { + QFile file(fileName); + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + return QString("Could not open file: %1").arg(fileName); + } + + QTextStream in(&file); + + QList fields; + while (!in.atEnd()) { + QString line = in.readLine(); + fields.append(parseCSVLine(line)); + } + + if (fields.empty()) { + return "CSV file appears to be empty"; + } + + qint64 txidField = -1; + qint64 descriptionField = -1; + + QStringList header = fields[0]; + for (int i = 0; i < header.length(); i++) { + if (header[i] == "txid") { + txidField = i; + continue; + } + if (header[i] == "description") { + descriptionField = i; + } + } + + if (txidField < 0) { + return "'txid' field not found in CSV header"; + } + if (descriptionField < 0) { + return "'description' field not found in CSV header"; + } + qint64 maxIndex = std::max(txidField, descriptionField); + + QList> descriptions; + + for (int i = 1; i < fields.length(); i++) { + const auto& row = fields[i]; + if (maxIndex >= row.length()) { + qDebug() << "Row with invalid length in CSV"; + continue; + } + + if (row[txidField].isEmpty()) { + continue; + } + + if (row[descriptionField].isEmpty()) { + continue; + } + + descriptions.push_back({row[txidField], row[descriptionField]}); + } + + for (const auto& description : descriptions) { + qDebug() << "Setting note for tx:" << description.first << "description:" << description.second; + this->setTxNote(description.first, description.second); + } + + this->refresh(); + + return {}; +} diff --git a/src/libwalletqt/TransactionHistory.h b/src/libwalletqt/TransactionHistory.h index ce10b8e..7b0d5b4 100644 --- a/src/libwalletqt/TransactionHistory.h +++ b/src/libwalletqt/TransactionHistory.h @@ -34,7 +34,6 @@ public: TransactionRow* transaction(int index); void refresh(); void setTxNote(const QString &txid, const QString ¬e); - bool writeCSV(const QString &path); quint64 count() const; QDateTime firstDateTime() const; QDateTime lastDateTime() const; @@ -42,6 +41,9 @@ public: bool locked() const; void clearRows(); + bool writeCSV(const QString &path); + QString importLabelsFromCSV(const QString &fileName); + signals: void refreshStarted() const; void refreshFinished() const; diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 770718a..ce5f494 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -74,10 +74,6 @@ Wallet::Wallet(Monero::Wallet *wallet, QObject *parent) this->updateBalance(); } - connect(this->history(), &TransactionHistory::txNoteChanged, [this]{ - this->history()->refresh(); - }); - connect(this, &Wallet::refreshed, this, &Wallet::onRefreshed); connect(this, &Wallet::newBlock, this, &Wallet::onNewBlock); connect(this, &Wallet::updated, this, &Wallet::onUpdated); diff --git a/src/model/TransactionHistoryModel.cpp b/src/model/TransactionHistoryModel.cpp index 932b43d..5e87563 100644 --- a/src/model/TransactionHistoryModel.cpp +++ b/src/model/TransactionHistoryModel.cpp @@ -236,6 +236,8 @@ bool TransactionHistoryModel::setData(const QModelIndex &index, const QVariant & hash = tInfo.hash(); }); m_transactionHistory->setTxNote(hash, value.toString()); + m_transactionHistory->refresh(); + emit transactionDescriptionChanged(); break; } default: diff --git a/src/model/TransactionHistoryModel.h b/src/model/TransactionHistoryModel.h index d84a6d7..38f467d 100644 --- a/src/model/TransactionHistoryModel.h +++ b/src/model/TransactionHistoryModel.h @@ -45,6 +45,7 @@ public: signals: void transactionHistoryChanged(); + void transactionDescriptionChanged(); private: QVariant parseTransactionInfo(const TransactionRow &tInfo, int column, int role) const; From 2f11cf2710c27bc99ad752271dde173f0333b807 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 16:08:28 +0200 Subject: [PATCH 61/76] revuo: add upcoming events --- src/plugins/revuo/RevuoItem.h | 11 +++-- src/plugins/revuo/RevuoWidget.cpp | 79 +++++++++++++++++-------------- src/plugins/revuo/RevuoWidget.h | 8 ++-- src/plugins/revuo/RevuoWidget.ui | 56 +++++++++++----------- 4 files changed, 83 insertions(+), 71 deletions(-) diff --git a/src/plugins/revuo/RevuoItem.h b/src/plugins/revuo/RevuoItem.h index 2499608..4b466e5 100644 --- a/src/plugins/revuo/RevuoItem.h +++ b/src/plugins/revuo/RevuoItem.h @@ -7,13 +7,18 @@ #include #include -struct RevuoItem { - RevuoItem(const QString &title, const QString &url, const QStringList &newsbytes) - : title(title), url(url), newsbytes(newsbytes){}; +struct RevuoItem : QObject +{ + Q_OBJECT + +public: + explicit RevuoItem(QObject *parent) + : QObject(parent) {}; QString title; QString url; QStringList newsbytes; + QList> events; }; #endif //FEATHER_REVUOITEM_H diff --git a/src/plugins/revuo/RevuoWidget.cpp b/src/plugins/revuo/RevuoWidget.cpp index a2442e3..304e04e 100644 --- a/src/plugins/revuo/RevuoWidget.cpp +++ b/src/plugins/revuo/RevuoWidget.cpp @@ -8,28 +8,24 @@ #include "utils/ColorScheme.h" #include "Utils.h" +#include "utils/Icons.h" #include "utils/WebsocketNotifier.h" RevuoWidget::RevuoWidget(QWidget *parent) : QWidget(parent) , ui(new Ui::RevuoWidget) - , m_contextMenu(new QMenu(this)) { ui->setupUi(this); ui->textBrowser->setOpenLinks(false); ui->textBrowser->document()->setDefaultStyleSheet("a {color: white; }"); + ui->textBrowser->setText("

No item selected

"); connect(ui->textBrowser, &QTextBrowser::anchorClicked, this, &RevuoWidget::onLinkActivated); - ui->textBrowser->setText("

No item selected

"); + ui->btn_openLink->setIcon(icons()->icon("external-link.svg")); + connect(ui->btn_openLink, &QPushButton::clicked, this, &RevuoWidget::onOpenLink); - m_contextMenu->addAction("Open link", this, &RevuoWidget::onOpenLink); - m_contextMenu->addAction("Donate to author", this, &RevuoWidget::onDonate); - - ui->splitter->setStretchFactor(1, 5); - - connect(ui->listWidget, &QListWidget::currentTextChanged, this, &RevuoWidget::onSelectItem); - connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &RevuoWidget::showContextMenu); + connect(ui->combo_issue, &QComboBox::currentIndexChanged, this, &RevuoWidget::onSelectItem); connect(websocketNotifier(), &WebsocketNotifier::dataReceived, this, [this](const QString& type, const QJsonValue& json) { if (type == "revuo") { @@ -39,18 +35,21 @@ RevuoWidget::RevuoWidget(QWidget *parent) for (const auto &entry: revuo_data) { auto obj = entry.toObject(); - QStringList newsbytes; + QSharedPointer item = QSharedPointer(new RevuoItem(this)); + for (const auto &n : obj.value("newsbytes").toArray()) { - newsbytes.append(n.toString()); + item->newsbytes.append(n.toString()); } - auto revuoItem = new RevuoItem( - obj.value("title").toString(), - obj.value("url").toString(), - newsbytes); + for (const auto &e : obj.value("events").toArray()) { + auto f = e.toObject(); + item->events.append({f.value("date").toString(), f.value("description").toString()}); + } - QSharedPointer r = QSharedPointer(revuoItem); - l.append(r); + item->title = obj.value("title").toString(); + item->url = obj.value("url").toString(); + + l.append(item); } this->updateItems(l); @@ -59,6 +58,10 @@ RevuoWidget::RevuoWidget(QWidget *parent) } void RevuoWidget::updateItems(const QList> &items) { + m_items.clear(); + m_links.clear(); + ui->combo_issue->clear(); + QStringList titles; for (const auto &item : items) { titles << item->title; @@ -67,26 +70,34 @@ void RevuoWidget::updateItems(const QList> &items) { for (const auto &newsbyte : item->newsbytes) { text += "

• " + newsbyte + "

\n"; } - text += QString("
\nRead the whole issue in your browser.").arg(item->url); + text += "

Upcoming Events

\n"; + if (item->events.isEmpty()) { + text += "

There are no upcoming events.

\n"; + } + for (const auto &event : item->events) { + text += "

" + event.first + "

\n"; + text += "

" + event.second + "

\n"; + } + text += "
"; + text += QString("Read the whole issue in your browser.").arg(item->url); text += "

\nEnjoy Revuo? Consider a donation to the author."; - m_items[item->title] = text; - m_links[item->title] = item->url; + m_items.append(text); + m_links.append(item->url); + ui->combo_issue->addItem(item->title); } - ui->listWidget->clear(); - ui->listWidget->addItems(titles); - ui->listWidget->setCurrentRow(0); - ui->listWidget->setMinimumWidth(ui->listWidget->sizeHintForColumn(0) + 10); + ui->combo_issue->setCurrentIndex(0); + } -void RevuoWidget::onSelectItem(const QString &item) { - auto *currentItem = ui->listWidget->currentItem(); - if (currentItem == nullptr) { +void RevuoWidget::onSelectItem(int index) { + if (index >= m_items.length()) { + ui->textBrowser->setText("

No item selected

"); return; } - QString title = currentItem->text(); - ui->textBrowser->setText(m_items[title]); + + ui->textBrowser->setText(m_items[index]); } void RevuoWidget::onLinkActivated(const QUrl &link) { @@ -98,12 +109,8 @@ void RevuoWidget::onLinkActivated(const QUrl &link) { Utils::externalLinkWarning(this, link.toString()); } -void RevuoWidget::showContextMenu(const QPoint &pos) { - m_contextMenu->exec(ui->listWidget->viewport()->mapToGlobal(pos)); -} - void RevuoWidget::onOpenLink() { - QString currentItem = ui->listWidget->currentItem()->text(); + int currentItem = ui->combo_issue->currentIndex(); Utils::externalLinkWarning(this, m_links[currentItem]); } @@ -119,7 +126,7 @@ void RevuoWidget::skinChanged() { auto stylesheet = QString("a {color: %1; }").arg(color); ui->textBrowser->document()->setDefaultStyleSheet(stylesheet); - this->onSelectItem(""); + this->onSelectItem(0); } -RevuoWidget::~RevuoWidget() = default; \ No newline at end of file +RevuoWidget::~RevuoWidget() = default; diff --git a/src/plugins/revuo/RevuoWidget.h b/src/plugins/revuo/RevuoWidget.h index 334b0af..a583a2c 100644 --- a/src/plugins/revuo/RevuoWidget.h +++ b/src/plugins/revuo/RevuoWidget.h @@ -30,17 +30,15 @@ public slots: private slots: void onLinkActivated(const QUrl &link); - void onSelectItem(const QString &item); + void onSelectItem(int index); void onOpenLink(); void onDonate(); - void showContextMenu(const QPoint &pos); private: QScopedPointer ui; - QMenu *m_contextMenu; - QHash m_items; - QHash m_links; + QStringList m_items; + QStringList m_links; }; diff --git a/src/plugins/revuo/RevuoWidget.ui b/src/plugins/revuo/RevuoWidget.ui index a44477a..ed0c4c7 100644 --- a/src/plugins/revuo/RevuoWidget.ui +++ b/src/plugins/revuo/RevuoWidget.ui @@ -14,34 +14,36 @@ Form - - 0 - - - 0 - - - 0 - - - 0 - - - - Qt::Horizontal - - - - Qt::CustomContextMenu - - - - - - - - + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + From e721e74b6e7fc167d9f7c0a0d0afb5bb9df708ea Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 17:36:33 +0200 Subject: [PATCH 62/76] mainwindow: improve donation reminder --- src/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 324ea90..1be5eb8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1798,8 +1798,8 @@ void MainWindow::donationNag() { donationCounter++; if (donationCounter % constants::donationBoundary == 0) { - auto msg = "Feather is a 100% community-sponsored endeavor. Please consider supporting " - "the project financially. Get rid of this message by donating any amount."; + auto msg = "Feather development is funded entirely through donations.\n\nPlease consider supporting " + "the project. Donate any amount to remove this reminder."; int ret = QMessageBox::information(this, "Donate to Feather", msg, QMessageBox::Yes, QMessageBox::No); if (ret == QMessageBox::Yes) { this->donateButtonClicked(); From 5ddf31a58b2f1c7302c203dea66e549684cfca9a Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 17:44:01 +0200 Subject: [PATCH 63/76] mainwindow: fix hide balance if fiat is enabled --- src/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 1be5eb8..f852263 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -615,7 +615,7 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) { } } - if (conf()->get(Config::balanceShowFiat).toBool()) { + if (conf()->get(Config::balanceShowFiat).toBool() && !hide) { QString fiatCurrency = conf()->get(Config::preferredFiatCurrency).toString(); double balanceFiatAmount = appData()->prices.convert("XMR", fiatCurrency, balance / constants::cdiv); balance_str += QString(" (%1)").arg(Utils::amountToCurrencyString(balanceFiatAmount, fiatCurrency)); From 90505aaa32cc2d6d931d8149f33cd8fb552492c2 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 18:02:00 +0200 Subject: [PATCH 64/76] assets: update restore heights --- src/assets/restore_heights_monero_mainnet.txt | 28 ++++++++++++++++++- .../restore_heights_monero_stagenet.txt | 28 ++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/assets/restore_heights_monero_mainnet.txt b/src/assets/restore_heights_monero_mainnet.txt index 65cd546..f99a1ab 100644 --- a/src/assets/restore_heights_monero_mainnet.txt +++ b/src/assets/restore_heights_monero_mainnet.txt @@ -2141,4 +2141,30 @@ 1723042527:3210000 1723220196:3211500 1723401886:3213000 -1723577283:3214500 \ No newline at end of file +1723577283:3214500 +1723758523:3216000 +1723943045:3217500 +1724123516:3219000 +1724300973:3220500 +1724484278:3222000 +1724666887:3223500 +1724849987:3225000 +1725015093:3226500 +1725197019:3228000 +1725383293:3229500 +1725558474:3231000 +1725742245:3232500 +1725924657:3234000 +1726105045:3235500 +1726283197:3237000 +1726463211:3238500 +1726636517:3240000 +1726818897:3241500 +1727000277:3243000 +1727180466:3244500 +1727359618:3246000 +1727542507:3247500 +1727723723:3249000 +1727906604:3250500 +1728083420:3252000 +1728259944:3253500 \ No newline at end of file diff --git a/src/assets/restore_heights_monero_stagenet.txt b/src/assets/restore_heights_monero_stagenet.txt index 932d14e..fb96722 100644 --- a/src/assets/restore_heights_monero_stagenet.txt +++ b/src/assets/restore_heights_monero_stagenet.txt @@ -1108,4 +1108,30 @@ 1722983267:1660500 1723166957:1662000 1723347339:1663500 -1723524898:1665000 \ No newline at end of file +1723524898:1665000 +1723704308:1666500 +1723860608:1668000 +1724036267:1669500 +1724260269:1671000 +1724443530:1672500 +1724620063:1674000 +1724802245:1675500 +1724981057:1677000 +1725166685:1678500 +1725344930:1680000 +1725518960:1681500 +1725706849:1683000 +1725884468:1684500 +1726020096:1686000 +1726227873:1687500 +1726405463:1689000 +1726586949:1690500 +1726765988:1692000 +1726945486:1693500 +1727125243:1695000 +1727307226:1696500 +1727549352:1698000 +1727727177:1699500 +1727908581:1701000 +1728092922:1702500 +1728273508:1704000 \ No newline at end of file From 8eb8d9fc3460b0d36afce3ea92be46e91ea2bdf4 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 19:15:48 +0200 Subject: [PATCH 65/76] revuo: fix bounds check --- src/plugins/revuo/RevuoWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/revuo/RevuoWidget.cpp b/src/plugins/revuo/RevuoWidget.cpp index 304e04e..84ea7f2 100644 --- a/src/plugins/revuo/RevuoWidget.cpp +++ b/src/plugins/revuo/RevuoWidget.cpp @@ -92,7 +92,7 @@ void RevuoWidget::updateItems(const QList> &items) { } void RevuoWidget::onSelectItem(int index) { - if (index >= m_items.length()) { + if (index >= m_items.length() || index < 0) { ui->textBrowser->setText("

No item selected

"); return; } From 78c4aac58a48ad94decc92615bf38ac05ec90472 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 21:16:12 +0200 Subject: [PATCH 66/76] update feather-docs submodule --- external/feather-docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/feather-docs b/external/feather-docs index 9abafde..4cad456 160000 --- a/external/feather-docs +++ b/external/feather-docs @@ -1 +1 @@ -Subproject commit 9abafde37423c204401a2322d152e8b3cc5d267a +Subproject commit 4cad456d5dd24eae5d30f3d3bdaef5690f558ec6 From c600e4d376db290e609aac7412dbf5084cf957db Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 7 Oct 2024 21:19:28 +0200 Subject: [PATCH 67/76] release: bump version to 2.7.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c5b1b4..78bfbb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.18) project(feather - VERSION "2.6.8" + VERSION "2.7.0" DESCRIPTION "A free Monero desktop wallet" LANGUAGES CXX C ASM ) From 130432fd23823ebb633b4985e5ef0ad304a98a1f Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 8 Oct 2024 19:15:55 +0200 Subject: [PATCH 68/76] SECURITY.md: add clarification on binary exploitation --- SECURITY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SECURITY.md b/SECURITY.md index 15a0081..501e312 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -35,6 +35,7 @@ Clarifications on scope: - Any form of coercion, physical or psychological, is out of scope. - Vulnerabilities that are attributable to hardware are out of scope. - If the issue was fixed in the `master` branch before we receive your report, it is invalid and not eligible for a bounty from this program. +- If the vulnerability involves binary exploitation, we may ask you to provide a proof of concept of secret key exfiltration. - Vulnerabilities that are present in the monero submodule but were not introduced in patches made by the Feather developers must be reported [upstream](https://github.com/monero-project/meta/blob/master/VULNERABILITY_RESPONSE_PROCESS.md) and are not eligible for a bounty from this program. - Vulnerabilities that are present in any of our third-party dependencies must be reported upstream and are not eligible for a bounty from this program. From 2e91a0dc9f4887b7dfaabc6237a7f1f768288c6b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Oct 2024 15:46:51 +0200 Subject: [PATCH 69/76] update MAINTENANCE.md --- MAINTENANCE.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 9243eba..2985600 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -28,7 +28,19 @@ Goals: Security issues that affect Feather always warrant a new release as soon as possible. -### 2. Reproducibility +### 2. Continuity + +- Keep the website and services online +- Keep source repositories accessible +- Make sure that running release builds is easy to set up and reproducible in time + +Goals: + +- Make sure the project is transmissible +- Make sure that setting up release infrastructure, release engineering, and maintenance are extensively documented +- Make the websocket server repository public + +### 3. Reproducibility - Improve and maintain tools to check for non-determinism - Ensure releases are reproducible and stay that way @@ -40,32 +52,32 @@ To learn more about Feather's build system, see: [`contrib/guix/README.md`](http Our Guix time-machine is currently pinned at a commit which implements the [Full-Source Bootstrap](https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/). -### 3. Bugs +### 4. Bugs - Fix bugs and crashes To report a bug, please see: https://docs.featherwallet.org/guides/report-an-issue -### 4. Tests +### 5. Tests - Improve test coverage - Write more test cases Feather does not currently have a test suite (apart from the tests in the Monero submodule), this is a WIP. -### 5. Documentation +### 6. Documentation - Make sure the documentation accurately reflects the latest release - Add troubleshooting guides for common problems - - Ideally, most support questions can be answered with a link to the documentation Goals: +- Most support questions can be answered with a link to the documentation - Reconsider and document default settings - Write a document on threat modeling Documentation is available at https://docs.featherwallet.org -### 6. Improvements +### 7. Improvements - Improve existing features - Improve UI/UX @@ -73,7 +85,7 @@ Documentation is available at https://docs.featherwallet.org Feather should first and foremost be a good __wallet__. Improving features that are closer to this end should have priority. -### 7. Platform Support +### 8. Platform Support - Add support for more architectures and operating systems - Drop support for End-of-Life distributions @@ -81,7 +93,7 @@ Improving features that are closer to this end should have priority. See: https://docs.featherwallet.org/guides/supported-operating-systems -### 8. Optimization, cleanup and continuity +### 9. Optimization Miscellaneous maintenance tasks. @@ -99,9 +111,9 @@ Miscellaneous maintenance tasks. Goals: -- Make sure Feather is ready for the migration to [Seraphis](https://github.com/seraphis-migration/wallet3) +- Make sure Feather is ready for the migration to [FCMP++](https://www.getmonero.org/2024/04/27/fcmps.html) -### 9. Features +### 10. Features - Implement new features - Allow Feather to be used or configured for higher, esoteric or new threat models @@ -113,7 +125,7 @@ compared to its expected maintenance and support burden. For a non-exhaustive list of potentially new features, see: https://featherwallet.org/ideas -### 10. Upstreaming +### 11. Upstreaming - Upstream tried and tested features, bugfixes and useful patches - Bugfixes should be upstreamed without delay From 52546c5660040b5d815c16576048bddba5c60fc4 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Oct 2024 19:14:41 +0200 Subject: [PATCH 70/76] updater: fix status text --- src/utils/updater/UpdateDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/updater/UpdateDialog.cpp b/src/utils/updater/UpdateDialog.cpp index c7aab33..0f2d122 100644 --- a/src/utils/updater/UpdateDialog.cpp +++ b/src/utils/updater/UpdateDialog.cpp @@ -243,7 +243,7 @@ void UpdateDialog::onInstallUpdate() { } if (m_updater->platformTag == "win-installer") { - this->setStatus("Installer written. Click 'restart' to close Feather and start the installer."); + this->setStatus("Installer written. Click 'Restart Feather' to close Feather and start the installer."); } else { this->setStatus("Installation successful. Do you want to restart Feather now?"); } From 1ac76ddceea8a823f4ca73c136cbffa90ad4f4f6 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Oct 2024 19:31:58 +0200 Subject: [PATCH 71/76] wizard: menu: auto-focus next button --- src/wizard/PageMenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wizard/PageMenu.cpp b/src/wizard/PageMenu.cpp index e318c06..e09d917 100644 --- a/src/wizard/PageMenu.cpp +++ b/src/wizard/PageMenu.cpp @@ -4,6 +4,8 @@ #include "PageMenu.h" #include "ui_PageMenu.h" +#include + #include "config-feather.h" #include "WalletWizard.h" @@ -28,6 +30,10 @@ void PageMenu::initializePage() { ui->radioCreate->setChecked(true); } + QTimer::singleShot(0, [this]{ + wizard()->button(QWizard::NextButton)->setFocus(); + }); + // Don't show setup wizard again conf()->set(Config::firstRun, false); } From d1f4dfb0b8a7f92c3365f6ce2abcb732846fbe08 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Oct 2024 19:52:23 +0200 Subject: [PATCH 72/76] DocsDialog: don't close on pressing enter --- src/dialog/DocsDialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dialog/DocsDialog.cpp b/src/dialog/DocsDialog.cpp index c86d2f8..2591dff 100644 --- a/src/dialog/DocsDialog.cpp +++ b/src/dialog/DocsDialog.cpp @@ -134,6 +134,12 @@ DocsDialog::DocsDialog(QWidget *parent) this->updateHighlights(ui->search->text()); }); + // Pressing 'enter' in the search box shouldn't close the dialog + QPushButton *closeButton = ui->buttonBox->button(QDialogButtonBox::Close); + if (closeButton) { + closeButton->setAutoDefault(false); + } + this->showDoc("report_an_issue"); } From c2b5c051dad89069d1006be399643d42cd2dab6b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Oct 2024 22:51:45 +0200 Subject: [PATCH 73/76] crowdfunding: update magic grants url --- src/plugins/crowdfunding/CCSWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/crowdfunding/CCSWidget.cpp b/src/plugins/crowdfunding/CCSWidget.cpp index 6a50eb4..4c1f91f 100644 --- a/src/plugins/crowdfunding/CCSWidget.cpp +++ b/src/plugins/crowdfunding/CCSWidget.cpp @@ -59,7 +59,7 @@ CCSWidget::CCSWidget(QWidget *parent) c->url = QString("https://ccs.getmonero.org/%1").arg(urlpath); } else if (c->organizer == "MAGIC") { - c->url = QString("https://monerofund.org/%1").arg(urlpath); + c->url = QString("https://donate.magicgrants.org/%1").arg(urlpath); } else { continue; From 796d4dd3f02c8938dbc5d4fbb4869dde115221e6 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 10 Oct 2024 14:03:46 +0200 Subject: [PATCH 74/76] send: fix uri handling from scanned QR code --- src/SendWidget.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SendWidget.cpp b/src/SendWidget.cpp index 418e2b8..5a3c371 100644 --- a/src/SendWidget.cpp +++ b/src/SendWidget.cpp @@ -45,7 +45,7 @@ SendWidget::SendWidget(Wallet *wallet, QWidget *parent) connect(ui->lineAmount, &QLineEdit::textChanged, this, &SendWidget::amountEdited); connect(ui->lineAddress, &QPlainTextEdit::textChanged, this, &SendWidget::addressEdited); connect(ui->btn_openAlias, &QPushButton::clicked, this, &SendWidget::aliasClicked); - connect(ui->lineAddress, &PayToEdit::dataPasted, this, &SendWidget::onDataPasted); + connect(ui->lineAddress, &PayToEdit::dataPasted, this, &SendWidget::onDataFromQR); ui->label_conversionAmount->setText(""); ui->label_conversionAmount->hide(); ui->btn_openAlias->hide(); @@ -140,7 +140,7 @@ void SendWidget::scanClicked() { auto dialog = new QrCodeScanDialog(this, false); dialog->exec(); - ui->lineAddress->setText(dialog->decodedString()); + this->onDataFromQR(dialog->decodedString()); dialog->deleteLater(); #else Utils::showError(this, "Can't open QR scanner", "Feather was built without webcam QR scanner support"); @@ -402,13 +402,17 @@ void SendWidget::setSubtractFeeFromAmountEnabled(bool enabled) { ui->check_subtractFeeFromAmount->setVisible(enabled); } -void SendWidget::onDataPasted(const QString &data) { +void SendWidget::onDataFromQR(const QString &data) { if (!data.isEmpty()) { QVariantMap uriData = m_wallet->parse_uri_to_object(data); if (!uriData.contains("error")) { ui->lineAddress->setText(uriData.value("address").toString()); ui->lineDescription->setText(uriData.value("tx_description").toString()); - ui->lineAmount->setText(uriData.value("amount").toString()); + + // Strip trailing zeroes + auto amountStr = uriData.value("amount").toString(); + auto amount = WalletManager::amountFromString(amountStr); + ui->lineAmount->setText(WalletManager::displayAmount(amount, false)); } else { ui->lineAddress->setText(data); } From fdc7a09c6c4b6fb1c3c60c6d991206a51549a729 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 10 Oct 2024 14:22:47 +0200 Subject: [PATCH 75/76] coins: don't refresh for each freeze/thaw --- src/CoinsWidget.cpp | 10 ++---- src/SendWidget.h | 2 +- src/libwalletqt/Coins.cpp | 68 +++++++++++++++++++++------------------ src/libwalletqt/Coins.h | 8 ++--- 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/src/CoinsWidget.cpp b/src/CoinsWidget.cpp index 9c582da..8c15c7a 100644 --- a/src/CoinsWidget.cpp +++ b/src/CoinsWidget.cpp @@ -324,18 +324,12 @@ QVector CoinsWidget::currentEntries() { } void CoinsWidget::freezeCoins(QStringList &pubkeys) { - for (auto &pubkey : pubkeys) { - m_wallet->coins()->freeze(pubkey); - } - m_wallet->coins()->refresh(); + m_wallet->coins()->freeze(pubkeys); m_wallet->updateBalance(); } void CoinsWidget::thawCoins(QStringList &pubkeys) { - for (auto &pubkey : pubkeys) { - m_wallet->coins()->thaw(pubkey); - } - m_wallet->coins()->refresh(); + m_wallet->coins()->thaw(pubkeys); m_wallet->updateBalance(); } diff --git a/src/SendWidget.h b/src/SendWidget.h index 1b310f2..85efbf8 100644 --- a/src/SendWidget.h +++ b/src/SendWidget.h @@ -49,7 +49,7 @@ public slots: void disallowSending(); private slots: - void onDataPasted(const QString &data); + void onDataFromQR(const QString &data); private: void setupComboBox(); diff --git a/src/libwalletqt/Coins.cpp b/src/libwalletqt/Coins.cpp index c5de0aa..27b08b9 100644 --- a/src/libwalletqt/Coins.cpp +++ b/src/libwalletqt/Coins.cpp @@ -105,48 +105,52 @@ quint64 Coins::count() const return m_rows.length(); } -void Coins::freeze(QString &publicKey) +void Coins::freeze(QStringList &publicKeys) { crypto::public_key pk; - if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk)) - { - qWarning() << "Invalid public key: " << publicKey; - return; + + for (const auto& publicKey : publicKeys) { + if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk)) + { + qWarning() << "Invalid public key: " << publicKey; + continue; + } + + try + { + m_wallet2->freeze(pk); + } + catch (const std::exception& e) + { + qWarning() << "freeze: " << e.what(); + } } - try - { - m_wallet2->freeze(pk); - refresh(); - } - catch (const std::exception& e) - { - qWarning() << "freeze: " << e.what(); - } - - emit coinFrozen(); + refresh(); } -void Coins::thaw(QString &publicKey) +void Coins::thaw(QStringList &publicKeys) { crypto::public_key pk; - if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk)) - { - qWarning() << "Invalid public key: " << publicKey; - return; + + for (const auto& publicKey : publicKeys) { + if (!epee::string_tools::hex_to_pod(publicKey.toStdString(), pk)) + { + qWarning() << "Invalid public key: " << publicKey; + continue; + } + + try + { + m_wallet2->thaw(pk); + } + catch (const std::exception& e) + { + qWarning() << "thaw: " << e.what(); + } } - try - { - m_wallet2->thaw(pk); - refresh(); - } - catch (const std::exception& e) - { - qWarning() << "thaw: " << e.what(); - } - - emit coinThawed(); + refresh(); } QVector Coins::coins_from_txid(const QString &txid) diff --git a/src/libwalletqt/Coins.h b/src/libwalletqt/Coins.h index ce875c0..7ea1e40 100644 --- a/src/libwalletqt/Coins.h +++ b/src/libwalletqt/Coins.h @@ -31,8 +31,10 @@ public: CoinsInfo * coin(int index); void refresh(); void refreshUnlocked(); - void freeze(QString &publicKey); - void thaw(QString &publicKey); + + void freeze(QStringList &publicKeys); + void thaw(QStringList &publicKeys); + QVector coins_from_txid(const QString &txid); QVector coinsFromKeyImage(const QStringList &keyimages); void setDescription(const QString &publicKey, quint32 accountIndex, const QString &description); @@ -43,8 +45,6 @@ public: signals: void refreshStarted() const; void refreshFinished() const; - void coinFrozen() const; - void coinThawed() const; void descriptionChanged() const; private: From 2707a26d3c8857e4c9a3f15f52c2a709755c1077 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 11 Oct 2024 11:24:13 +0200 Subject: [PATCH 76/76] guix: update mingw-w64 to 12.0.0 --- contrib/guix/libexec/prelude.bash | 2 +- contrib/guix/patches/winpthreads-remap-guix-store.patch | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash index b81799f..2527f91 100644 --- a/contrib/guix/libexec/prelude.bash +++ b/contrib/guix/libexec/prelude.bash @@ -51,7 +51,7 @@ fi time-machine() { # shellcheck disable=SC2086 guix time-machine --url=https://github.com/tobtoht/guix.git \ - --commit=f0bb724211872cd6158fce6162e0b8c73efed126 \ + --commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \ --cores="$JOBS" \ --keep-failed \ --fallback \ diff --git a/contrib/guix/patches/winpthreads-remap-guix-store.patch b/contrib/guix/patches/winpthreads-remap-guix-store.patch index 2c12585..e1f1a6e 100644 --- a/contrib/guix/patches/winpthreads-remap-guix-store.patch +++ b/contrib/guix/patches/winpthreads-remap-guix-store.patch @@ -6,12 +6,12 @@ the package, map all guix store prefixes to something fixed, e.g. /usr. --- a/mingw-w64-libraries/winpthreads/Makefile.in +++ b/mingw-w64-libraries/winpthreads/Makefile.in -@@ -454,7 +454,7 @@ top_build_prefix = @top_build_prefix@ +@@ -478,7 +478,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . tests --AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN -+AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) +-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) ++AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libwinpthread.la include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h