Skip to content

Commit 2e48b28

Browse files
committed
Fix compilation failure after syncing to 31st Dec. 2024
1 parent 064ba6f commit 2e48b28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+797
-1232
lines changed

CMakeLists.txt

+127-171
Large diffs are not rendered by default.

cmake/BGL-build-config.h.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@
121121
#cmakedefine HAVE_VM_VM_PARAM_H 1
122122

123123
/* Define to the address where bug reports for this package should be sent. */
124-
#define PACKAGE_BUGREPORT "@CLIENT_BUGREPORT@"
124+
#define CLIENT_BUGREPORT "@CLIENT_BUGREPORT@"
125125

126126
/* Define to the full name of this package. */
127-
#define PACKAGE_NAME "@CLIENT_NAME@"
127+
#define CLIENT_NAME "@CLIENT_NAME@"
128128

129129
/* Define to the home page for this package. */
130-
#define PACKAGE_URL "@PROJECT_HOMEPAGE_URL@"
130+
#define CLIENT_URL "@PROJECT_HOMEPAGE_URL@"
131131

132132
/* Define to the version of this package. */
133-
#define PACKAGE_VERSION "@CLIENT_VERSION_STRING@"
133+
#define CLIENT_VERSION_STRING "@CLIENT_VERSION_STRING@"
134134

135135
/* Define to 1 if strerror_r returns char *. */
136136
#cmakedefine STRERROR_R_CHAR_P 1

src/BGL-wallet-res.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ BEGIN
1515
BLOCK "040904E4" // U.S. English - multilingual (hex)
1616
BEGIN
1717
VALUE "CompanyName", "Bitgesell"
18-
VALUE "FileDescription", "BGL-cli (JSON-RPC client for " CLIENT_NAME ")"
18+
VALUE "FileDescription", "BGL-wallet (CLI tool for " CLIENT_NAME " wallets)"
1919
VALUE "FileVersion", CLIENT_VERSION_STRING
20-
VALUE "InternalName", "BGL-cli"
20+
VALUE "InternalName", "BGL-wallet"
2121
VALUE "LegalCopyright", COPYRIGHT_STR
2222
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
23-
VALUE "OriginalFilename", "BGL-cli.exe"
24-
VALUE "ProductName", "BGL-cli"
23+
VALUE "OriginalFilename", "BGL-wallet.exe"
24+
VALUE "ProductName", "BGL-wallet"
2525
VALUE "ProductVersion", CLIENT_VERSION_STRING
2626
END
2727
END

src/BGL-wallet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[
6868
} else {
6969
strUsage += "\n"
7070
"BGL-wallet is an offline tool for creating and interacting with " CLIENT_NAME " wallet files.\n\n"
71-
"By default bitcoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n\n"
71+
"By default BGL-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n\n"
7272
"To change the target wallet, use the -datadir, -wallet and (test)chain selection arguments.\n"
7373
"\n"
7474
"Usage: BGL-wallet [options] <command>\n"

src/CMakeLists.txt

+18-52
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# file COPYING or https://opensource.org/license/mit/.
44

55
include(GNUInstallDirs)
6+
include(AddWindowsResources)
67

78
configure_file(${PROJECT_SOURCE_DIR}/cmake/BGL-build-config.h.in BGL-build-config.h USE_SOURCE_PERMISSIONS @ONLY)
89
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -16,7 +17,7 @@ add_custom_target(generate_build_info
1617
add_library(BGL_clientversion OBJECT EXCLUDE_FROM_ALL
1718
clientversion.cpp
1819
)
19-
target_link_libraries(bitgesell_clientversion
20+
target_link_libraries(BGL_clientversion
2021
PRIVATE
2122
core_interface
2223
)
@@ -29,8 +30,6 @@ if(WITH_MULTIPROCESS)
2930
add_subdirectory(ipc)
3031
endif()
3132

32-
add_subdirectory(univalue)
33-
3433
#=============================
3534
# secp256k1 subtree
3635
#=============================
@@ -366,7 +365,7 @@ target_link_libraries(BGL_cli
366365
# Bitcoin Core RPC client
367366
if(BUILD_CLI)
368367
add_executable(BGL-cli BGL-cli.cpp)
369-
add_windows_resources(BGL-cli BGL-cli-res.rc)
368+
add_windows_resources(BGL-cli BUILDSYSTEM_TARGETS-cli-res.rc)
370369
target_link_libraries(BGL-cli
371370
core_interface
372371
BGL_cli
@@ -375,37 +374,20 @@ if(BUILD_CLI)
375374
libevent::core
376375
libevent::extra
377376
)
378-
unset(${PROJECT_NAME}_windows)
379-
endif()
380-
unset(${PROJECT_NAME}_soversion)
381-
382-
if(SECP256K1_BUILD_BENCHMARK)
383-
add_executable(bench bench.c)
384-
target_link_libraries(bench secp256k1)
385-
add_executable(bench_internal bench_internal.c)
386-
target_link_libraries(bench_internal secp256k1_precomputed secp256k1_asm)
387-
add_executable(bench_ecmult bench_ecmult.c)
388-
target_link_libraries(bench_ecmult secp256k1_precomputed secp256k1_asm)
377+
list(APPEND installable_targets BGL-cli)
389378
endif()
390379

391-
if(SECP256K1_BUILD_TESTS)
392-
add_executable(noverify_tests tests.c)
393-
target_link_libraries(noverify_tests secp256k1_precomputed secp256k1_asm)
394-
add_test(NAME secp256k1_noverify_tests COMMAND noverify_tests)
395-
if(NOT CMAKE_BUILD_TYPE STREQUAL "Coverage")
396-
add_executable(tests tests.c)
397-
target_compile_definitions(tests PRIVATE VERIFY)
398-
target_link_libraries(tests secp256k1_precomputed secp256k1_asm)
399-
add_test(NAME secp256k1_tests COMMAND tests)
400-
endif()
401-
endif()
402380

403-
if(SECP256K1_BUILD_EXHAUSTIVE_TESTS)
404-
# Note: do not include secp256k1_precomputed in exhaustive_tests (it uses runtime-generated tables).
405-
add_executable(exhaustive_tests tests_exhaustive.c)
406-
target_link_libraries(exhaustive_tests secp256k1_asm)
407-
target_compile_definitions(exhaustive_tests PRIVATE $<$<NOT:$<CONFIG:Coverage>>:VERIFY>)
408-
add_test(NAME secp256k1_exhaustive_tests COMMAND exhaustive_tests)
381+
if(BUILD_TX)
382+
add_executable(BGL-tx BGL-tx.cpp)
383+
add_windows_resources(BGL-tx BGL-tx-res.rc)
384+
target_link_libraries(BGL-tx
385+
core_interface
386+
BGL_common
387+
BGL_util
388+
univalue
389+
)
390+
list(APPEND installable_targets BGL-tx)
409391
endif()
410392

411393

@@ -443,26 +425,10 @@ if(BUILD_UTIL_CHAINSTATE)
443425
set_target_properties(BGL-chainstate PROPERTIES
444426
SKIP_BUILD_RPATH OFF
445427
)
446-
if(SECP256K1_ENABLE_MODULE_ECDH)
447-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_ecdh.h")
448-
endif()
449-
if(SECP256K1_ENABLE_MODULE_RECOVERY)
450-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_recovery.h")
451-
endif()
452-
if(SECP256K1_ENABLE_MODULE_EXTRAKEYS)
453-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_extrakeys.h")
454-
endif()
455-
if(SECP256K1_ENABLE_MODULE_SCHNORRSIG)
456-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_schnorrsig.h")
457-
endif()
458-
if(SECP256K1_ENABLE_MODULE_MUSIG)
459-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_musig.h")
460-
endif()
461-
if(SECP256K1_ENABLE_MODULE_ELLSWIFT)
462-
list(APPEND ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/include/secp256k1_ellswift.h")
463-
endif()
464-
install(FILES ${${PROJECT_NAME}_headers}
465-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
428+
target_link_libraries(BGL-chainstate
429+
PRIVATE
430+
core_interface
431+
BGLkernel
466432
)
467433
endif()
468434

src/bench/CMakeLists.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
include(GenerateHeaders)
66
generate_header_from_raw(data/block413567.raw benchmark::data)
77

8-
add_executable(bench_bitcoin
9-
bench_bitcoin.cpp
8+
add_executable(bench_BGL
9+
bench_BGL.cpp
1010
bench.cpp
1111
nanobench.cpp
1212
${CMAKE_CURRENT_BINARY_DIR}/data/block413567.raw.h
@@ -56,15 +56,15 @@ add_executable(bench_bitcoin
5656
xor.cpp
5757
)
5858

59-
target_link_libraries(bench_bitcoin
59+
target_link_libraries(bench_BGL
6060
core_interface
6161
test_util
62-
bitcoin_node
62+
BGL_node
6363
Boost::headers
6464
)
6565

6666
if(ENABLE_WALLET)
67-
target_sources(bench_bitcoin
67+
target_sources(bench_BGL
6868
PRIVATE
6969
coin_selection.cpp
7070
wallet_balance.cpp
@@ -74,13 +74,13 @@ if(ENABLE_WALLET)
7474
wallet_ismine.cpp
7575
wallet_migration.cpp
7676
)
77-
target_link_libraries(bench_bitcoin bitcoin_wallet)
77+
target_link_libraries(bench_BGL BGL_wallet)
7878
endif()
7979

8080
add_test(NAME bench_sanity_check_high_priority
81-
COMMAND bench_bitcoin -sanity-check -priority-level=high
81+
COMMAND bench_BGL -sanity-check -priority-level=high
8282
)
8383

84-
install(TARGETS bench_bitcoin
84+
install(TARGETS bench_BGL
8585
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
8686
)

src/cluster_linearize.h

+15-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
#ifndef BGL_CLUSTER_LINEARIZE_H
66
#define BGL_CLUSTER_LINEARIZE_H
77

8+
#include <algorithm>
9+
#include <numeric>
10+
#include <optional>
811
#include <stdint.h>
912
#include <vector>
1013
#include <utility>
1114

1215
#include <random.h>
16+
#include <span.h>
1317
#include <util/feefrac.h>
1418
#include <util/vecdeque.h>
1519

@@ -767,7 +771,9 @@ class SearchCandidateFinder
767771
// processing loop below, and during the add_fn/split_fn calls, we do not need to deal
768772
// with the best=empty case.
769773
if (best.feerate.IsEmpty()) best = SetInfo(m_sorted_depgraph, component);
770-
queue.emplace_back(/*inc=*/SetInfo<SetType>{}, /*und=*/std::move(component));
774+
queue.emplace_back(/*inc=*/SetInfo<SetType>{},
775+
/*und=*/std::move(component),
776+
/*pot_feerate=*/FeeFrac{});
771777
} while (to_cover.Any());
772778

773779
/** Local copy of the iteration limit. */
@@ -782,7 +788,8 @@ class SearchCandidateFinder
782788
}
783789

784790
/** Internal function to add an item to the queue of elements to explore if there are any
785-
* transactions left to split on, and to update best/imp.
791+
* transactions left to split on, possibly improving it before doing so, and to update
792+
* best/imp.
786793
*
787794
* - inc: the "inc" value for the new work item (must be topological).
788795
* - und: the "und" value for the new work item ((inc | und) must be topological).
@@ -854,7 +861,9 @@ class SearchCandidateFinder
854861
// space runs out (see below), we know that no reallocation of the queue should ever
855862
// occur.
856863
Assume(queue.size() < queue.capacity());
857-
queue.emplace_back(/*inc=*/std::move(inc), /*und=*/std::move(und));
864+
queue.emplace_back(/*inc=*/std::move(inc),
865+
/*und=*/std::move(und),
866+
/*pot_feerate=*/std::move(pot.feerate));
858867
};
859868

860869
/** Internal process function. It takes an existing work item, and splits it in two: one
@@ -996,6 +1005,8 @@ class SearchCandidateFinder
9961005
* @param[in] rng_seed A random number seed to control search order. This prevents peers
9971006
* from predicting exactly which clusters would be hard for us to
9981007
* linearize.
1008+
* @param[in] old_linearization An existing linearization for the cluster (which must be
1009+
* topologically valid), or empty.
9991010
* @return A pair of:
10001011
* - The resulting linearization. It is guaranteed to be at least as
10011012
* good (in the feerate diagram sense) as old_linearization.
@@ -1005,7 +1016,7 @@ class SearchCandidateFinder
10051016
* Complexity: possibly O(N * min(max_iterations + N, sqrt(2^N))) where N=depgraph.TxCount().
10061017
*/
10071018
template<typename SetType>
1008-
std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& depgraph, uint64_t max_iterations, uint64_t rng_seed) noexcept
1019+
std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& depgraph, uint64_t max_iterations, uint64_t rng_seed, Span<const ClusterIndex> old_linearization = {}) noexcept
10091020
{
10101021
Assume(old_linearization.empty() || old_linearization.size() == depgraph.TxCount());
10111022
if (depgraph.TxCount() == 0) return {{}, true};

src/coins.h

+1-17
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,6 @@ struct CCoinsCacheEntry
174174
SetClean();
175175
}
176176

177-
//! Adding a flag also requires a self reference to the pair that contains
178-
//! this entry in the CCoinsCache map and a reference to the sentinel of the
179-
//! flagged pair linked list.
180-
static void AddFlags(uint8_t flags, CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept
181-
{
182-
Assume(flags & (DIRTY | FRESH));
183-
if (!pair.second.m_flags) {
184-
Assume(!pair.second.m_prev && !pair.second.m_next);
185-
pair.second.m_prev = sentinel.second.m_prev;
186-
pair.second.m_next = &sentinel;
187-
sentinel.second.m_prev = &pair;
188-
pair.second.m_prev->second.m_next = &pair;
189-
}
190-
Assume(pair.second.m_prev && pair.second.m_next);
191-
pair.second.m_flags |= flags;
192-
}
193177
static void SetDirty(CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { AddFlags(DIRTY, pair, sentinel); }
194178
static void SetFresh(CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { AddFlags(FRESH, pair, sentinel); }
195179

@@ -542,4 +526,4 @@ class CCoinsViewErrorCatcher final : public CCoinsViewBacked
542526

543527
};
544528

545-
#endif // BGL_COINS_H
529+
#endif // BGL_COINS_H

src/common/netif.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
44

5-
#include <bitcoin-build-config.h> // IWYU pragma: keep
5+
#include <BGL-build-config.h> // IWYU pragma: keep
66

77
#include <common/netif.h>
88

src/common/netif.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_COMMON_NETIF_H
6-
#define BITCOIN_COMMON_NETIF_H
5+
#ifndef BGL_COMMON_NETIF_H
6+
#define BGL_COMMON_NETIF_H
77

88
#include <netaddress.h>
99

@@ -16,4 +16,4 @@ std::optional<CNetAddr> QueryDefaultGateway(Network network);
1616
//! Return all local non-loopback IPv4 and IPv6 network addresses.
1717
std::vector<CNetAddr> GetLocalAddresses();
1818

19-
#endif // BITCOIN_COMMON_NETIF_H
19+
#endif // BGL_COMMON_NETIF_H

src/crc32c/src/crc32c.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file. See the AUTHORS file for names of contributors.
44

5-
#include "crc32c/crc32c.h"
5+
#include "../include/crc32c/crc32c.h"
66

77
#include <cstddef>
88
#include <cstdint>

0 commit comments

Comments
 (0)