From c84628b93ec62a9f8dd505d8cce5d9359164d6e0 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:11:48 +0200 Subject: [PATCH 01/13] 22 >> 22.1 --- build-aux/m4/digibyte_qt.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/m4/digibyte_qt.m4 b/build-aux/m4/digibyte_qt.m4 index cc0abc6390..3cd236ad5b 100644 --- a/build-aux/m4/digibyte_qt.m4 +++ b/build-aux/m4/digibyte_qt.m4 @@ -350,7 +350,7 @@ AC_DEFUN([_DIGIBYTE_QT_CHECK_STATIC_LIBS], [ PKG_CHECK_MODULES([QT_FONTDATABASE], [${qt_lib_prefix}FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="$QT_FONTDATABASE_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QT_THEME], [${qt_lib_prefix}ThemeSupport${qt_lib_suffix}], [QT_LIBS="$QT_THEME_LIBS $QT_LIBS"]) if test "x$TARGET_OS" = xlinux; then - PKG_CHECK_MODULES([QT_INPUT], [${qt_lib_prefix}XcbQpa], [QT_LIBS="$QT_INPUT_LIBS $QT_LIBS"]) + PKG_CHECK_MODULES([QT_INPUT], [${qt_lib_prefix}InputSupport], [QT_LIBS="$QT_INPUT_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QT_XCBQPA], [${qt_lib_prefix}XcbQpa], [QT_LIBS="$QT_XCBQPA_LIBS $QT_LIBS"]) elif test "x$TARGET_OS" = xdarwin; then From 8725f4d715db43c8e1de185a9e43a53543813d71 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:13:53 +0200 Subject: [PATCH 02/13] 22 >> 22.1 --- .cirrus.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 2a0f558740..74e961dbb6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -122,10 +122,10 @@ task: FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh" task: - name: '[depends, sanitizers: thread (TSan), no gui] [hirsute]' + name: '[depends, sanitizers: thread (TSan), no gui] [jammy]' << : *GLOBAL_TASK_TEMPLATE container: - image: ubuntu:hirsute + image: ubuntu:jammy cpu: 6 # Increase CPU and Memory to avoid timeout memory: 24G env: @@ -143,10 +143,10 @@ task: FILE_ENV: "./ci/test/00_setup_env_native_msan.sh" task: - name: '[no depends, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer] [hirsute]' + name: '[no depends, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer] [jammy]' << : *GLOBAL_TASK_TEMPLATE container: - image: ubuntu:hirsute + image: ubuntu:jammy env: << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" From 1b1d2daf267810d2abc49263d35f8ee6daa8e9a8 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:15:04 +0200 Subject: [PATCH 03/13] Update 00_setup_env_native_asan.sh --- ci/test/00_setup_env_native_asan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index 05fd87231e..5756b9878c 100755 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_asan export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev" -export DOCKER_NAME_TAG=ubuntu:hirsute +export DOCKER_NAME_TAG=ubuntu:22.04 export NO_DEPENDS=1 export GOAL="install" export DIGIBYTE_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++" From 73e8cbaf5fcd53024063b1abd25576025f6dc71c Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:15:57 +0200 Subject: [PATCH 04/13] 22 >> 22.1 --- ci/test/00_setup_env_native_tsan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index a5f11e4857..fc4138e567 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_tsan -export DOCKER_NAME_TAG=ubuntu:hirsute +export DOCKER_NAME_TAG=ubuntu:22.04 export PACKAGES="clang llvm libc++abi-dev libc++-dev python3-zmq" export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'" export GOAL="install" From 15a0e047637377cdb564a35f9a3bfb547952549e Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:17:24 +0200 Subject: [PATCH 05/13] Update configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 19cc5271e2..9f1e37aef4 100644 --- a/configure.ac +++ b/configure.ac @@ -568,7 +568,7 @@ AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=arm TEMP_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS" -AC_MSG_CHECKING(for ARM CRC32 intrinsics) +AC_MSG_CHECKING(for AArch64 CRC32 intrinsics) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include From eb5072ec5bbf29827e2dc97054b225a45130f67c Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:18:58 +0200 Subject: [PATCH 06/13] 22 >> 22.1 --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 9f1e37aef4..d1317860bd 100644 --- a/configure.ac +++ b/configure.ac @@ -573,8 +573,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ +#ifdef __aarch64__ __crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0); vmull_p64(0, 0); +#else +#error "crc32c library does not support hardware acceleration on 32-bit ARM" +#endif ]])], [ AC_MSG_RESULT(yes); enable_arm_crc=yes; ], [ AC_MSG_RESULT(no)] From 07a845d831d8e9dbee087d12fad67cb3ba53fb3a Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:21:06 +0200 Subject: [PATCH 07/13] 22 >> 22.1 --- contrib/guix/libexec/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 345a5bee57..1ee1d4d6c9 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -156,8 +156,8 @@ case "$HOST" in arm-linux-gnueabihf) echo /lib/ld-linux-armhf.so.3 ;; aarch64-linux-gnu) echo /lib/ld-linux-aarch64.so.1 ;; riscv64-linux-gnu) echo /lib/ld-linux-riscv64-lp64d.so.1 ;; - powerpc64-linux-gnu) echo /lib/ld64.so.1;; - powerpc64le-linux-gnu) echo /lib/ld64.so.2;; + powerpc64-linux-gnu) echo /lib64/ld64.so.1;; + powerpc64le-linux-gnu) echo /lib64/ld64.so.2;; *) exit 1 ;; esac ) From 754a3bc27bed0093c118c0ac72201dba0f3edaae Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:31:16 +0200 Subject: [PATCH 08/13] 22 >> 22.1 --- src/fs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fs.cpp b/src/fs.cpp index 5de6505816..55d19dfc4b 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -16,6 +16,7 @@ #define NOMINMAX #endif #include +#include #include #endif From df3fa74e4d46947fe9f351dc545606c809686379 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:33:34 +0200 Subject: [PATCH 09/13] Update init.cpp --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 98e254b902..32ce2e196e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -222,7 +222,7 @@ void Shutdown(NodeContext& node) node.banman.reset(); node.addrman.reset(); - if (node.mempool && node.mempool->IsLoaded() && node.args->GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { + if (node.mempool && node.mempool->IsLoaded() && node.args->GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { DumpMempool(*node.mempool); } From 42c5e1e77d30f3d434ced6db03d3c669017e9906 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:36:07 +0200 Subject: [PATCH 10/13] 22 >> 22.1 --- src/node/blockstorage.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index ea9d372d1f..e964bfd374 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -394,18 +394,14 @@ bool ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos, const Consensus::P bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams) { - FlatFilePos blockPos; - { - LOCK(cs_main); - blockPos = pindex->GetBlockPos(); - } + const FlatFilePos block_pos{WITH_LOCK(cs_main, return pindex->GetBlockPos())}; - if (!ReadBlockFromDisk(block, blockPos, consensusParams)) { + if (!ReadBlockFromDisk(block, block_pos, consensusParams)) { return false; } if (block.GetHash() != pindex->GetBlockHash()) { return error("ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index for %s at %s", - pindex->ToString(), pindex->GetBlockPos().ToString()); + pindex->ToString(), block_pos.ToString()); } return true; } From d9c0d9de1c984023712ec6180f0471165add18ef Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:40:12 +0200 Subject: [PATCH 11/13] 22 >> 22.1 --- src/util/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/system.cpp b/src/util/system.cpp index b4b6cc06c2..e420666b8e 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1306,7 +1306,7 @@ void SetupEnvironment() #endif // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale // may be invalid, in which case the "C.UTF-8" locale is used as fallback. -#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) try { std::locale(""); // Raises a runtime error if current locale is invalid } catch (const std::runtime_error&) { From a5d33689a3753b54df77bab6205bb3b1d547cd9f Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:42:11 +0200 Subject: [PATCH 12/13] 22 >> 22.1 --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 912823ed64..ae04f142f5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4008,7 +4008,7 @@ bool CChainState::LoadBlockIndexDB() void CChainState::LoadMempool(const ArgsManager& args) { if (!m_mempool) return; - if (args.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { + if (args.GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { ::LoadMempool(*m_mempool, *this); } m_mempool->SetIsLoaded(!ShutdownRequested()); From aa6aee54b58831a9485127bc6046f0457c9a1423 Mon Sep 17 00:00:00 2001 From: Jan <125610144+Jongjan88@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:45:08 +0200 Subject: [PATCH 13/13] 22 >> 22.1 --- src/wallet/wallet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 07fd6c387c..e903da7693 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1367,9 +1367,10 @@ CAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) co bool CWallet::IsHDEnabled() const { // All Active ScriptPubKeyMans must be HD for this to be true - bool result = true; + bool result = false; for (const auto& spk_man : GetActiveScriptPubKeyMans()) { - result &= spk_man->IsHDEnabled(); + if (!spk_man->IsHDEnabled()) return false; + result = true; } return result; } @@ -3193,7 +3194,8 @@ void CWallet::LoadActiveScriptPubKeyMan(uint256 id, OutputType type, bool intern auto spk_man = m_spk_managers.at(id).get(); spk_mans[type] = spk_man; - if (spk_mans_other[type] == spk_man) { + const auto it = spk_mans_other.find(type); + if (it != spk_mans_other.end() && it->second == spk_man) { spk_mans_other.erase(type); }