mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
Merge #6362: backport: trivial 2024 10 25 pr1
b6544791b4
Merge bitcoin/bitcoin#30705: test: Avoid intermittent block download timeout in p2p_ibd_stalling (merge-script)745a819683
Merge bitcoin/bitcoin#30690: devtools, utxo-snapshot: Fix block height out of range in script (Ava Chow)01b570e9e2
Merge bitcoin/bitcoin#29999: guix: fix suggested fake date for openssl-1.1.1l (Ava Chow)432f352719
Merge bitcoin/bitcoin#30580: doc: Add note about distro's `g++-mingw-w64-x86-64-posix` version (merge-script)1bd090e7fb
Merge bitcoin/bitcoin#30597: doc: Drop no longer needed workaround for WSL (merge-script)8a12237745
Merge bitcoin/bitcoin#30630: doc: Update ccache website link (merge-script)f66547f84e
Merge bitcoin/bitcoin#30588: depends: fix ZMQ CMake getcachesize check (merge-script)ddaec964c0
Merge bitcoin/bitcoin#30565: depends: Fix `zeromq` build on OpenBSD (merge-script)e4e5605ef8
Merge bitcoin/bitcoin#30552: test: fix constructor of msg_tx (merge-script)df3c2392ca
Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for Windows cross-compile (merge-script)57945ce337
Merge bitcoin/bitcoin#30506: depends: Cleanup postprocess commands after switching to CMake (merge-script)e016ffada1
Merge bitcoin/bitcoin#29878: depends: build expat with CMake (merge-script)62dcd43b58
Merge bitcoin/bitcoin#29880: depends: build FreeType with CMake (merge-script)745addf6a7
Merge bitcoin/bitcoin#30245: net: Allow -proxy=[::1] on nodes with IPV6 lo only (Ava Chow)4e144be0dd
Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible (Hennadii Stepanov)69c04b2c48
Merge bitcoin/bitcoin#30372: util: Use SteadyClock in RandAddSeedPerfmon (merge-script)ebed8af1d0
Merge bitcoin/bitcoin#30336: depends: update doc in Qt pwd patch (merge-script)9793fb1a87
Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found error using gettxoutsetinfo (Ava Chow)479cb8bcb8
Merge bitcoin/bitcoin#30312: contrib: add R(UN)PATH check to ELF symbol-check (merge-script)ca83773854
Merge bitcoin/bitcoin#30283: upnp: fix build with miniupnpc 2.2.8 (merge-script)63e139d11b
Merge bitcoin/bitcoin#30185: guix: show `*_FLAGS` variables in pre-build output (merge-script)3be0d3e5cd
Merge bitcoin/bitcoin#30097: crypto: disable asan for sha256_sse4 with clang and -O0 (merge-script)3070c3e388
Merge bitcoin/bitcoin#30078: depends: set AR & RANLIB for CMake (merge-script) Pull request description: ## Issue being fixed or feature implemented Trivial backports ## What was done? ## How Has This Been Tested? built locally ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACKb6544791b4
kwvg: utACKb6544791b4
Tree-SHA512: 10b5af4e92c83fa9d6764b20bf066bba8e4c600402966fd5c1d6dad07b0549d8a42151a33f21e2f8263336c12a810a6f3fc2828d90bc98153e09c165d9e5b043
This commit is contained in:
commit
565f2db930
@ -220,6 +220,11 @@ def check_exported_symbols(binary) -> bool:
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def check_RUNPATH(binary) -> bool:
|
||||
assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None
|
||||
assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None
|
||||
return True
|
||||
|
||||
def check_ELF_libraries(binary) -> bool:
|
||||
ok: bool = True
|
||||
for library in binary.libraries:
|
||||
@ -280,6 +285,7 @@ lief.EXE_FORMATS.ELF: [
|
||||
('LIBRARY_DEPENDENCIES', check_ELF_libraries),
|
||||
('INTERPRETER_NAME', check_ELF_interpreter),
|
||||
('ABI', check_ELF_ABI),
|
||||
('RUNPATH', check_RUNPATH),
|
||||
],
|
||||
lief.EXE_FORMATS.MACHO: [
|
||||
('DYNAMIC_LIBRARIES', check_MACHO_libraries),
|
||||
|
@ -36,6 +36,16 @@ if (( GENERATE_AT_HEIGHT < PRUNED )); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check current block height to ensure the node has synchronized past the required block
|
||||
CURRENT_BLOCK_HEIGHT=$(${BITCOIN_CLI_CALL} getblockcount)
|
||||
PIVOT_BLOCK_HEIGHT=$(( GENERATE_AT_HEIGHT + 1 ))
|
||||
|
||||
if (( PIVOT_BLOCK_HEIGHT > CURRENT_BLOCK_HEIGHT )); then
|
||||
(>&2 echo "Error: The node has not yet synchronized to block height ${PIVOT_BLOCK_HEIGHT}.")
|
||||
(>&2 echo "Please wait until the node has synchronized past this block height and try again.")
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Early exit if file at OUTPUT_PATH already exists
|
||||
if [[ -e "$OUTPUT_PATH" ]]; then
|
||||
(>&2 echo "Error: $OUTPUT_PATH already exists or is not a valid path.")
|
||||
|
@ -671,6 +671,8 @@ More information: https://github.com/python/cpython/issues/81765
|
||||
OpenSSL includes tests that will fail once some certificate has expired.
|
||||
The workarounds from the GnuTLS section immediately below can be used.
|
||||
|
||||
For openssl-1.1.1l use 2022-05-01 as the date.
|
||||
|
||||
### GnuTLS: test-suite FAIL: status-request-revoked
|
||||
|
||||
*The derivation is likely identified by: `/gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv`*
|
||||
@ -705,11 +707,12 @@ authorized.
|
||||
This workaround was described [here](https://issues.guix.gnu.org/44559#5).
|
||||
|
||||
Basically:
|
||||
2. Turn off NTP
|
||||
3. Set system time to 2020-10-01
|
||||
4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
|
||||
5. Set system time back to accurate current time
|
||||
6. Turn NTP back on
|
||||
|
||||
1. Turn off NTP
|
||||
2. Set system time to 2020-10-01
|
||||
3. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
|
||||
4. Set system time back to accurate current time
|
||||
5. Turn NTP back on
|
||||
|
||||
For example,
|
||||
|
||||
|
@ -360,6 +360,10 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}:
|
||||
...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")'
|
||||
...outputting in: '$(outdir_for_host "$HOST")'
|
||||
...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")'
|
||||
ADDITIONAL FLAGS (if set)
|
||||
ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS}
|
||||
ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS}
|
||||
ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS}
|
||||
EOF
|
||||
|
||||
# Run the build script 'contrib/guix/libexec/build.sh' in the build
|
||||
|
@ -181,6 +181,9 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
|
||||
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
|
||||
LDFLAGS="$$($(1)_ldflags)" \
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \
|
||||
-DCMAKE_AR=`which $$($(1)_ar)` \
|
||||
-DCMAKE_NM=`which $$($(1)_nm)` \
|
||||
-DCMAKE_RANLIB=`which $$($(1)_ranlib)` \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib/ \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=$(V) \
|
||||
|
@ -3,19 +3,25 @@ $(package)_version=2.4.8
|
||||
$(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=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
|
||||
$(package)_build_subdir=build
|
||||
$(package)_patches += cmake_minimum.patch
|
||||
|
||||
# -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
|
||||
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF
|
||||
$(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF
|
||||
$(package)_config_opts += -DBUILD_SHARED_LIBS=OFF
|
||||
$(package)_cppflags += -D_DEFAULT_SOURCE
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
$($(package)_cmake) -S .. -B .
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
@ -27,5 +33,5 @@ define $(package)_stage_cmds
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf share lib/cmake lib/*.la
|
||||
rm -rf share lib/cmake
|
||||
endef
|
||||
|
@ -3,14 +3,17 @@ $(package)_version=2.11.0
|
||||
$(package)_download_path=https://download.savannah.gnu.org/releases/$(package)
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7
|
||||
$(package)_build_subdir=build
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
|
||||
$(package)_config_opts += --enable-option-checking --without-brotli
|
||||
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE
|
||||
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE
|
||||
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
|
||||
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
$($(package)_cmake) -S .. -B .
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
@ -21,6 +24,3 @@ define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf share/man lib/*.la
|
||||
endef
|
||||
|
@ -36,7 +36,7 @@ define $(package)_stage_cmds
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm bin/event_rpcgen.py && \
|
||||
rm -rf bin && \
|
||||
rm include/ev*.h && \
|
||||
rm include/event2/*_compat.h
|
||||
endef
|
||||
|
@ -28,3 +28,8 @@ define $(package)_stage_cmds
|
||||
install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
|
||||
install libminiupnpc.a $($(package)_staging_prefix_dir)/lib
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf bin && \
|
||||
rm -rf share
|
||||
endef
|
||||
|
@ -28,3 +28,7 @@ endef
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf share
|
||||
endef
|
||||
|
@ -8,7 +8,9 @@ $(package)_patches = remove_libstd_link.patch
|
||||
$(package)_patches += macos_mktemp_check.patch
|
||||
$(package)_patches += builtin_sha1.patch
|
||||
$(package)_patches += fix_have_windows.patch
|
||||
$(package)_patches += openbsd_kqueue_headers.patch
|
||||
$(package)_patches += cmake_minimum.patch
|
||||
$(package)_patches += cacheline_undefined.patch
|
||||
$(package)_patches += no_librt.patch
|
||||
$(package)_patches += fix_mingw_link.patch
|
||||
|
||||
@ -27,7 +29,9 @@ define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/cacheline_undefined.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/no_librt.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch
|
||||
@ -46,5 +50,5 @@ define $(package)_stage_cmds
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf bin share lib/*.la
|
||||
rm -rf share
|
||||
endef
|
||||
|
13
depends/patches/expat/cmake_minimum.patch
Normal file
13
depends/patches/expat/cmake_minimum.patch
Normal file
@ -0,0 +1,13 @@
|
||||
build: set minimum required CMake to 3.16
|
||||
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -33,7 +33,7 @@
|
||||
# Unlike most of Expat,
|
||||
# this file is copyrighted under the BSD-license for buildsystem files of KDE.
|
||||
|
||||
-cmake_minimum_required(VERSION 3.1.3)
|
||||
+cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# This allows controlling documented build time switches
|
||||
# when Expat is pulled in using the add_subdirectory function, e.g.
|
@ -1,13 +1,13 @@
|
||||
commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Tue Aug 18 15:09:06 2020 +0800
|
||||
Do not assume FHS in scripts
|
||||
|
||||
Don't hardcode pwd path
|
||||
On systems that do not follow the Filesystem Hierarchy Standard, such as
|
||||
guix, the hardcoded `/bin/pwd` will fail to be found so that the script
|
||||
will fail.
|
||||
|
||||
Let a man use his builtins if he wants to! Also, removes the unnecessary
|
||||
assumption that pwd lives under /bin/pwd.
|
||||
Use `pwd`, instead, so that the command can be found through the normal
|
||||
path search mechanism.
|
||||
|
||||
See #15581.
|
||||
See https://github.com/qt/qtbase/commit/3388de698bfb9bbc456c08f03e83bf3e749df35c.
|
||||
|
||||
diff --git a/qtbase/configure b/qtbase/configure
|
||||
index 08b49a8d..faea5b55 100755
|
||||
|
15
depends/patches/zeromq/cacheline_undefined.patch
Normal file
15
depends/patches/zeromq/cacheline_undefined.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Use proper STREQUAL instead of EQUAL to compare strings.txt
|
||||
|
||||
See: https://github.com/zeromq/libzmq/pull/4711.
|
||||
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -476,7 +476,7 @@ execute_process(
|
||||
if(CACHELINE_SIZE STREQUAL ""
|
||||
OR CACHELINE_SIZE EQUAL 0
|
||||
OR CACHELINE_SIZE EQUAL -1
|
||||
- OR CACHELINE_SIZE EQUAL "undefined")
|
||||
+ OR CACHELINE_SIZE STREQUAL "undefined")
|
||||
set(ZMQ_CACHELINE_SIZE 64)
|
||||
else()
|
||||
set(ZMQ_CACHELINE_SIZE ${CACHELINE_SIZE})
|
24
depends/patches/zeromq/openbsd_kqueue_headers.patch
Normal file
24
depends/patches/zeromq/openbsd_kqueue_headers.patch
Normal file
@ -0,0 +1,24 @@
|
||||
commit ff231d267370493814f933d151441866bf1e200b
|
||||
Author: Min RK <benjaminrk@gmail.com>
|
||||
Date: Fri Feb 23 13:21:08 2024 +0100
|
||||
|
||||
Problem: cmake search for kqueue missing headers
|
||||
|
||||
Solution: include sys/types.h and sys/time.h as documented by kqueue
|
||||
and used in autotools
|
||||
|
||||
fixes kqueue detection on openbsd
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f956f3fd..814d5d46 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -380,7 +380,7 @@ endif(WIN32)
|
||||
|
||||
if(NOT MSVC)
|
||||
if(POLLER STREQUAL "")
|
||||
- check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE)
|
||||
+ check_cxx_symbol_exists(kqueue "sys/types.h;sys/event.h;sys/time.h" HAVE_KQUEUE)
|
||||
if(HAVE_KQUEUE)
|
||||
set(POLLER "kqueue")
|
||||
endif()
|
@ -12,6 +12,9 @@ Other options which may work, but which have not been extensively tested are (pl
|
||||
|
||||
* On Windows, using a POSIX compatibility layer application such as [cygwin](https://www.cygwin.com/) or [msys2](https://www.msys2.org/).
|
||||
|
||||
The instructions below work on Ubuntu and Debian. Make sure the distribution's `g++-mingw-w64-x86-64-posix`
|
||||
package meets the minimum required `g++` version specified in [dependencies.md](dependencies.md).
|
||||
|
||||
Installing Windows Subsystem for Linux
|
||||
---------------------------------------
|
||||
|
||||
@ -52,7 +55,6 @@ is to temporarily disable WSL support for Win32 applications.
|
||||
|
||||
Build using:
|
||||
|
||||
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
|
||||
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications.
|
||||
cd depends
|
||||
make HOST=x86_64-w64-mingw32
|
||||
|
@ -33,7 +33,7 @@ The easiest way to faster compile times is to cache compiles. `ccache` is a way
|
||||
|
||||
Install `ccache` through your distribution's package manager, and run `./configure` with your normal flags to pick it up.
|
||||
|
||||
To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.samba.org/manual/latest.html#_run_modes) to set it up.
|
||||
To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.dev/manual/latest.html#_run_modes) to set it up.
|
||||
|
||||
To get the most out of ccache, put something like this in `~/.ccache/ccache.conf`:
|
||||
|
||||
|
@ -13,6 +13,13 @@
|
||||
namespace sha256_sse4
|
||||
{
|
||||
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)
|
||||
#if defined(__clang__) && !defined(__OPTIMIZE__)
|
||||
/*
|
||||
clang is unable to compile this with -O0 and -fsanitize=address.
|
||||
See upstream bug: https://github.com/llvm/llvm-project/issues/92182
|
||||
*/
|
||||
__attribute__((no_sanitize("address")))
|
||||
#endif
|
||||
{
|
||||
static const uint32_t K256 alignas(16) [] = {
|
||||
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
||||
|
@ -167,8 +167,11 @@ static bool ProcessUpnp()
|
||||
struct UPNPUrls urls;
|
||||
struct IGDdatas data;
|
||||
int r;
|
||||
|
||||
#if MINIUPNPC_API_VERSION <= 17
|
||||
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
|
||||
#else
|
||||
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
|
||||
#endif
|
||||
if (r == 1)
|
||||
{
|
||||
if (fDiscover) {
|
||||
|
@ -47,6 +47,7 @@ std::vector<CNetAddr> WrappedGetAddrInfo(const std::string& name, bool allow_loo
|
||||
ai_hint.ai_protocol = IPPROTO_TCP;
|
||||
// We don't care which address family (IPv4 or IPv6) is returned
|
||||
ai_hint.ai_family = AF_UNSPEC;
|
||||
|
||||
// If we allow lookups of hostnames, use the AI_ADDRCONFIG flag to only
|
||||
// return addresses whose family we have an address configured for.
|
||||
//
|
||||
@ -58,7 +59,17 @@ std::vector<CNetAddr> WrappedGetAddrInfo(const std::string& name, bool allow_loo
|
||||
addrinfo* ai_res{nullptr};
|
||||
const int n_err{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)};
|
||||
if (n_err != 0) {
|
||||
return {};
|
||||
if ((ai_hint.ai_flags & AI_ADDRCONFIG) == AI_ADDRCONFIG) {
|
||||
// AI_ADDRCONFIG on some systems may exclude loopback-only addresses
|
||||
// If first lookup failed we perform a second lookup without AI_ADDRCONFIG
|
||||
ai_hint.ai_flags = (ai_hint.ai_flags & ~AI_ADDRCONFIG);
|
||||
const int n_err_retry{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)};
|
||||
if (n_err_retry != 0) {
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// Traverse the linked list starting with ai_trav.
|
||||
|
@ -38,6 +38,7 @@ foreverHidden(false)
|
||||
parent->installEventFilter(this);
|
||||
raise();
|
||||
}
|
||||
ui->closeButton->installEventFilter(this);
|
||||
|
||||
blockProcessTime.clear();
|
||||
setVisible(false);
|
||||
@ -75,6 +76,11 @@ bool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) {
|
||||
raise();
|
||||
}
|
||||
}
|
||||
|
||||
if (obj == ui->closeButton && ev->type() == QEvent::FocusOut && layerIsVisible) {
|
||||
ui->closeButton->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(obj, ev);
|
||||
}
|
||||
|
||||
@ -195,6 +201,10 @@ void ModalOverlay::showHide(bool hide, bool userRequested)
|
||||
m_animation.setEndValue(QPoint(0, hide ? height() : 0));
|
||||
m_animation.start(QAbstractAnimation::KeepWhenStopped);
|
||||
layerIsVisible = !hide;
|
||||
|
||||
if (layerIsVisible) {
|
||||
ui->closeButton->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void ModalOverlay::closeClicked()
|
||||
|
@ -72,10 +72,10 @@ void RandAddSeedPerfmon(CSHA512& hasher)
|
||||
|
||||
// This can take up to 2 seconds, so only do it every 10 minutes.
|
||||
// Initialize last_perfmon to 0 seconds, we don't skip the first call.
|
||||
static std::atomic<std::chrono::seconds> last_perfmon{0s};
|
||||
static std::atomic<SteadyClock::time_point> last_perfmon{SteadyClock::time_point{0s}};
|
||||
auto last_time = last_perfmon.load();
|
||||
auto current_time = GetTime<std::chrono::seconds>();
|
||||
if (current_time < last_time + std::chrono::minutes{10}) return;
|
||||
auto current_time = SteadyClock::now();
|
||||
if (current_time < last_time + 10min) return;
|
||||
last_perfmon = current_time;
|
||||
|
||||
std::vector<unsigned char> vData(250000, 0);
|
||||
|
@ -7,14 +7,14 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <Windows.h> // For SecureZeroMemory.
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
void memory_cleanse(void *ptr, size_t len)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
/* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
|
||||
#if defined(WIN32)
|
||||
/* SecureZeroMemory is guaranteed not to be optimized out. */
|
||||
SecureZeroMemory(ptr, len);
|
||||
#else
|
||||
std::memset(ptr, 0, len);
|
||||
|
@ -261,6 +261,9 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||
)
|
||||
self.restart_node(1, extra_args=["-coinstatsindex"])
|
||||
|
||||
self.log.info("Test obtaining info for a non-existent block hash")
|
||||
assert_raises_rpc_error(-5, "Block not found", index_node.gettxoutsetinfo, hash_type="none", hash_or_height="ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", use_index=True)
|
||||
|
||||
def _test_use_index_option(self):
|
||||
self.log.info("Test use_index option for nodes running the index")
|
||||
|
||||
|
@ -76,6 +76,7 @@ class P2PIBDStallingTest(BitcoinTestFramework):
|
||||
peers = []
|
||||
|
||||
self.log.info("Check that a staller does not get disconnected if the 1024 block lookahead buffer is filled")
|
||||
self.mocktime = int(time.time()) + 1
|
||||
for id in range(NUM_PEERS):
|
||||
peers.append(node.add_outbound_p2p_connection(P2PStaller(stall_block), services = NODE_NETWORK | NODE_BLOOM, p2p_idx=id, connection_type="outbound-full-relay"))
|
||||
peers[-1].block_store = block_dict
|
||||
@ -88,7 +89,7 @@ class P2PIBDStallingTest(BitcoinTestFramework):
|
||||
|
||||
self.all_sync_send_with_ping(peers)
|
||||
# If there was a peer marked for stalling, it would get disconnected
|
||||
self.mocktime = int(time.time()) + 3
|
||||
self.mocktime += 3
|
||||
node.setmocktime(self.mocktime)
|
||||
self.all_sync_send_with_ping(peers)
|
||||
assert_equal(node.num_test_p2p_connections(), NUM_PEERS)
|
||||
|
@ -1724,8 +1724,11 @@ class msg_tx:
|
||||
__slots__ = ("tx",)
|
||||
msgtype = b"tx"
|
||||
|
||||
def __init__(self, tx=CTransaction()):
|
||||
self.tx = tx
|
||||
def __init__(self, tx=None):
|
||||
if tx is None:
|
||||
self.tx = CTransaction()
|
||||
else:
|
||||
self.tx = tx
|
||||
|
||||
def deserialize(self, f):
|
||||
self.tx.deserialize(f)
|
||||
|
Loading…
Reference in New Issue
Block a user