Skip to content

Commit 969f207

Browse files
committed
Merge branch 'auxpow'
2 parents 4dd2183 + e393fb1 commit 969f207

35 files changed

+396
-122
lines changed

cmake/secp256k1.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or https://opensource.org/license/mit/.
44

5+
enable_language(C)
6+
57
function(add_secp256k1 subdir)
68
message("")
79
message("Configuring secp256k1 subtree...")
@@ -30,7 +32,6 @@ function(add_secp256k1 subdir)
3032
string(STRIP "${SECP256K1_APPEND_LDFLAGS} ${APPEND_LDFLAGS}" SECP256K1_APPEND_LDFLAGS)
3133
set(SECP256K1_APPEND_LDFLAGS ${SECP256K1_APPEND_LDFLAGS} CACHE STRING "" FORCE)
3234
# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration.
33-
enable_language(C)
3435
foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES)
3536
if(config STREQUAL "")
3637
continue()

depends/packages/systemtap.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package=systemtap
2-
$(package)_version=4.8
2+
$(package)_version=5.3
33
$(package)_download_path=https://sourceware.org/ftp/systemtap/releases/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
5-
$(package)_sha256_hash=cbd50a4eba5b261394dc454c12448ddec73e55e6742fda7f508f9fbc1331c223
5+
$(package)_sha256_hash=966a360fb73a4b65a8d0b51b389577b3c4f92a327e84aae58682103e8c65a69a
66
$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
77

88
define $(package)_preprocess_cmds

share/setup.nsi.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ Section -post SEC0001
113113
WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Namecoin"
114114
WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
115115
WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
116+
117+
# Lingering since fb2b05b1259d3e69e6e675adfa30b429424c7625 which removed the suffix
118+
DeleteRegValue HKCU "${REGKEY} (64-bit)\Components" Main
119+
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name) (64-bit)"
120+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name) (64-bit).lnk"
121+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name) (64-bit).lnk"
122+
DeleteRegValue HKCU "${REGKEY} (64-bit)" StartMenuGroup
123+
DeleteRegValue HKCU "${REGKEY} (64-bit)" Path
124+
DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)\Components"
125+
DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)"
126+
127+
# Lingering since 77b2923f87131a407f7d4193c54db22375130403
128+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin Core (testnet, 64-bit).lnk"
116129
SectionEnd
117130

118131
# Macro for selecting uninstaller sections

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ if(BUILD_BITCOIN_BIN)
304304
add_windows_resources(bitcoin bitcoin-res.rc)
305305
add_windows_application_manifest(bitcoin)
306306
target_link_libraries(bitcoin core_interface bitcoin_util)
307-
install_binary_component(bitcoin)
307+
install_binary_component(bitcoin HAS_MANPAGE)
308308
endif()
309309

310310
# Bitcoin Core bitcoind.

src/common/system.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,25 @@
1111
#include <util/string.h>
1212
#include <util/time.h>
1313

14-
#ifndef WIN32
15-
#include <sys/stat.h>
16-
#else
17-
#include <compat/compat.h>
14+
#ifdef WIN32
1815
#include <codecvt>
16+
#include <compat/compat.h>
17+
#include <windows.h>
18+
#else
19+
#include <sys/stat.h>
20+
#include <unistd.h>
1921
#endif
2022

2123
#ifdef HAVE_MALLOPT_ARENA_MAX
2224
#include <malloc.h>
2325
#endif
2426

27+
#include <algorithm>
28+
#include <cstddef>
29+
#include <cstdint>
2530
#include <cstdlib>
2631
#include <locale>
32+
#include <optional>
2733
#include <stdexcept>
2834
#include <string>
2935
#include <thread>
@@ -105,6 +111,17 @@ int GetNumCores()
105111
return std::thread::hardware_concurrency();
106112
}
107113

114+
std::optional<size_t> GetTotalRAM()
115+
{
116+
auto clamp{[](uint64_t v) { return size_t(std::min(v, uint64_t{std::numeric_limits<size_t>::max()})); }};
117+
#ifdef WIN32
118+
if (MEMORYSTATUSEX m{}; (m.dwLength = sizeof(m), GlobalMemoryStatusEx(&m))) return clamp(m.ullTotalPhys);
119+
#elif defined(__linux__) || defined(__APPLE__)
120+
if (long p{sysconf(_SC_PHYS_PAGES)}, s{sysconf(_SC_PAGESIZE)}; p > 0 && s > 0) return clamp(1ULL * p * s);
121+
#endif
122+
return std::nullopt;
123+
}
124+
108125
// Obtain the application startup time (used for uptime calculation)
109126
int64_t GetStartupTime()
110127
{

src/common/system.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <bitcoin-build-config.h> // IWYU pragma: keep
1010

1111
#include <cstdint>
12+
#include <optional>
1213
#include <string>
1314

1415
// Application startup time (used for uptime calculation)
@@ -29,4 +30,9 @@ void runCommand(const std::string& strCommand);
2930
*/
3031
int GetNumCores();
3132

33+
/**
34+
* Return the total RAM available on the current system, if detectable.
35+
*/
36+
std::optional<size_t> GetTotalRAM();
37+
3238
#endif // BITCOIN_COMMON_SYSTEM_H

src/compat/compat.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ typedef unsigned int SOCKET;
7575
typedef SSIZE_T ssize_t;
7676
#endif
7777

78-
// The type of the option value passed to getsockopt & setsockopt
79-
// differs between Windows and non-Windows.
80-
#ifndef WIN32
81-
typedef void* sockopt_arg_type;
82-
#else
83-
typedef char* sockopt_arg_type;
84-
#endif
85-
8678
#ifdef WIN32
8779
// Export main() and ensure working ASLR when using mingw-w64.
8880
// Exporting a symbol will prevent the linker from stripping

src/httpserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
401401
// Set the no-delay option (disable Nagle's algorithm) on the TCP socket.
402402
evutil_socket_t fd = evhttp_bound_socket_get_fd(bind_handle);
403403
int one = 1;
404-
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (sockopt_arg_type)&one, sizeof(one)) == SOCKET_ERROR) {
404+
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&one), sizeof(one)) == SOCKET_ERROR) {
405405
LogInfo("WARNING: Unable to set TCP_NODELAY on RPC server socket, continuing anyway\n");
406406
}
407407
boundSockets.push_back(bind_handle);

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
17891789
// ********************************************************* Step 7: load block chain
17901790

17911791
// cache size calculations
1792+
node::LogOversizedDbCache(args);
17921793
const auto [index_cache_sizes, kernel_cache_sizes] = CalculateCacheSizes(args, g_enabled_filter_types.size());
17931794

17941795
LogInfo("Cache configuration:");

src/ipc/libmultiprocess/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CMake artifacts
2+
/*build*
3+
4+
# Git artifacts
5+
*.patch

0 commit comments

Comments
 (0)