Skip to content

Commit 879a9b7

Browse files
committedMar 26, 2024·
branch sync
1 parent 800092f commit 879a9b7

27 files changed

+210
-151
lines changed
 

‎build_msvc/BGL_config.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
#define CLIENT_VERSION_MAJOR 1
1616

1717
/* Minor version */
18-
#define CLIENT_VERSION_MINOR 8
18+
#define CLIENT_VERSION_MINOR 11
1919

2020
/* Copyright holder(s) before %s replacement */
2121
#define COPYRIGHT_HOLDERS "The %s developers"
2222

2323
/* Copyright holder(s) */
24-
#define COPYRIGHT_HOLDERS_FINAL "The Bitcoin Core developers / Bitcoin Core developers"
24+
#define COPYRIGHT_HOLDERS_FINAL "The Bitgesell Core developers / Bitgesell Core developers"
2525

2626
/* Replacement for %s in copyright holders string */
27-
#define COPYRIGHT_HOLDERS_SUBSTITUTION "Bitcoin Core"
27+
#define COPYRIGHT_HOLDERS_SUBSTITUTION "Bitgesell Core"
2828

2929
/* Copyright year */
30-
#define COPYRIGHT_YEAR 2022
30+
#define COPYRIGHT_YEAR 2024
3131

3232
/* Define to 1 to enable wallet functions */
3333
#define ENABLE_WALLET 1
@@ -174,19 +174,19 @@
174174
#define HAVE_SYS_TYPES_H 1
175175

176176
/* Define to the address where bug reports for this package should be sent. */
177-
#define PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues"
177+
#define PACKAGE_BUGREPORT "https://github.com/BitgesellOfficial/bitgesell/issues"
178178

179179
/* Define to the full name of this package. */
180180
#define PACKAGE_NAME "Bitgesell Core"
181181

182182
/* Define to the full name and version of this package. */
183-
#define PACKAGE_STRING "Bitgesell Core 22.99.0"
183+
#define PACKAGE_STRING "Bitgesell Core 0.1.11"
184184

185185
/* Define to the home page for this package. */
186186
#define PACKAGE_URL "https://bitgesell.ca/"
187187

188188
/* Define to the version of this package. */
189-
#define PACKAGE_VERSION "0.1.8"
189+
#define PACKAGE_VERSION "0.1.11"
190190

191191
/* Define this symbol if the minimal qt platform exists */
192192
#define QT_QPA_PLATFORM_MINIMAL 1

‎build_msvc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Introduction
55
---------------------
66
Visual Studio 2022 is minimum required to build BGL Core.
77

8-
Building with Visual Studio is an alternative to the Linux based [cross-compiler build](https://github.com/BitgesellOfficial/bitgesell/blob/master/doc/build-windows.md).
8+
Solution and project files to build with `msbuild` or Visual Studio can be found in the `build_msvc` directory.
99

1010
To build BGL Core from the command-line, it is sufficient to only install the [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) component.
1111

‎configure.ac

+11-6
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ AC_ARG_ENABLE([werror],
331331
AC_ARG_ENABLE([external-signer],
332332
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is auto, requires Boost::Process)])],
333333
[use_external_signer=$enableval],
334-
[use_external_signer=yes])
334+
[use_external_signer=auto])
335+
336+
AC_ARG_ENABLE([lto],
337+
[AS_HELP_STRING([--enable-lto],[build using LTO (default is no)])],
338+
[enable_lto=$enableval],
339+
[enable_lto=no])
335340

336341
AC_LANG_PUSH([C++])
337342

@@ -456,11 +461,11 @@ if test "$CXXFLAGS_overridden" = "no"; then
456461
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
457462
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
458463
dnl set the -Wno-foo case if it works.
459-
AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
460-
AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
461-
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
462-
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
463-
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
464+
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"], [], [$CXXFLAG_WERROR])
465+
AX_CHECK_COMPILE_FLAG([-Wself-assign], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"], [], [$CXXFLAG_WERROR])
466+
if test "$suppress_external_warnings" != "yes" ; then
467+
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"], [], [$CXXFLAG_WERROR])
468+
fi
464469
fi
465470

466471
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.

‎contrib/linearize/linearize-data.py

+1-30
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
import hashlib
1717
import datetime
1818
import time
19-
import glob
2019
from collections import namedtuple
2120

22-
23-
2421
settings = {}
2522

2623
def calc_hash_str(blk_hdr):
@@ -56,30 +53,6 @@ def mkblockmap(blkindex):
5653
blkmap[hash] = height
5754
return blkmap
5855

59-
# This gets the first block file ID that exists from the input block
60-
# file directory.
61-
def getFirstBlockFileId(block_dir_path):
62-
# First, this sets up a pattern to search for block files, for
63-
# example 'blkNNNNN.dat'.
64-
blkFilePattern = os.path.join(block_dir_path, "blk[0-9][0-9][0-9][0-9][0-9].dat")
65-
66-
# This search is done with glob
67-
blkFnList = glob.glob(blkFilePattern)
68-
69-
if len(blkFnList) == 0:
70-
print("blocks not pruned - starting at 0")
71-
return 0
72-
# We then get the lexicographic minimum, which should be the first
73-
# block file name.
74-
firstBlkFilePath = min(blkFnList)
75-
firstBlkFn = os.path.basename(firstBlkFilePath)
76-
77-
# now, the string should be ['b','l','k','N','N','N','N','N','.','d','a','t']
78-
# So get the ID by choosing: 3 4 5 6 7
79-
# The ID is not necessarily 0 if this is a pruned node.
80-
blkId = int(firstBlkFn[3:8])
81-
return blkId
82-
8356
# Block header and extent on disk
8457
BlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size'])
8558

@@ -89,9 +62,7 @@ def __init__(self, settings, blkindex, blkmap):
8962
self.blkindex = blkindex
9063
self.blkmap = blkmap
9164

92-
# Get first occurring block file id - for pruned nodes this
93-
# will not necessarily be 0
94-
self.inFn = getFirstBlockFileId(self.settings['input'])
65+
self.inFn = 0
9566
self.inF = None
9667
self.outFn = 0
9768
self.outsz = 0

‎contrib/seeds/generate-seeds.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
These should be pasted into `src/chainparamsseeds.h`.
2222
'''
23-
23+
from __future__ import print_function, division
2424
from base64 import b32decode
2525
from enum import Enum
2626
import struct
@@ -52,7 +52,7 @@ def name_to_bip155(addr):
5252
if len(vchAddr) == 32:
5353
return (BIP155Network.I2P, vchAddr)
5454
else:
55-
raise ValueError(f"Invalid I2P {vchAddr}")
55+
raise ValueError(f'Invalid I2P {vchAddr}')
5656
elif '.' in addr: # IPv4
5757
return (BIP155Network.IPV4, bytes((int(x) for x in addr.split('.'))))
5858
elif ':' in addr: # IPv6 or CJDNS
@@ -150,13 +150,13 @@ def process_nodes(g, f, structname):
150150
def main():
151151
if len(sys.argv)<2:
152152
print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)
153-
sys.exit(1)
153+
exit(1)
154154
g = sys.stdout
155155
indir = sys.argv[1]
156156
g.write('#ifndef BGL_CHAINPARAMSSEEDS_H\n')
157157
g.write('#define BGL_CHAINPARAMSSEEDS_H\n')
158158
g.write('/**\n')
159-
g.write(' * List of fixed seed nodes for the bitgesell network\n')
159+
g.write(' * List of fixed seed nodes for the falco network\n')
160160
g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n')
161161
g.write(' *\n')
162162
g.write(' * Each line contains a BIP155 serialized (networkID, addr, port) tuple.\n')

‎contrib/seeds/makeseeds.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def main():
216216
print(f'{ip_stats(ips):s} Require a known and recent user agent', file=sys.stderr)
217217
# Sort by availability (and use last success as tie breaker)
218218
ips.sort(key=lambda x: (x['uptime'], x['lastsuccess'], x['ip']), reverse=True)
219-
# Filter out hosts with multiple bitcoin ports, these are likely abusive
219+
# Filter out hosts with multiple ports, these are likely abusive
220220
ips = filtermultiport(ips)
221221
print(f'{ip_stats(ips):s} Filter out hosts with multiple BGL ports', file=sys.stderr)
222222
# Look up ASNs and limit results, both per ASN and globally.

‎depends/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ NO_UPNP ?=
4444
NO_USDT ?=
4545
NO_NATPMP ?=
4646
MULTIPROCESS ?=
47+
LTO ?=
48+
NO_HARDEN ?=
4749
FALLBACK_DOWNLOAD_PATH ?= https://bitgesell.ca/depends-sources
4850

51+
C_STANDARD ?= c11
52+
CXX_STANDARD ?= c++17
53+
4954
BUILD = $(shell ./config.guess)
5055
HOST ?= $(BUILD)
5156
PATCHES_PATH = $(BASEDIR)/patches

‎depends/README.md

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
### Usage
2+
3+
To build dependencies for the current arch+OS:
4+
5+
make
6+
7+
To build for another arch/OS:
8+
9+
make HOST=host-platform-triplet
10+
11+
For example:
12+
13+
make HOST=x86_64-w64-mingw32 -j4
14+
15+
**BGL Core's `configure` script by default will ignore the depends output.** In
16+
order for it to pick up libraries, tools, and settings from the depends build,
17+
you must set the `CONFIG_SITE` environment variable to point to a `config.site` settings file.
18+
Make sure that `CONFIG_SITE` is an absolute path.
19+
In the above example, a file named `depends/x86_64-w64-mingw32/share/config.site` will be
20+
created. To use it during compilation:
21+
22+
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure
23+
24+
The default install prefix when using `config.site` is `--prefix=depends/<host-platform-triplet>`,
25+
so depends build outputs will be installed in that location.
26+
27+
Common `host-platform-triplet`s for cross compilation are:
28+
29+
- `i686-pc-linux-gnu` for Linux 32 bit
30+
- `x86_64-pc-linux-gnu` for x86 Linux
31+
- `x86_64-w64-mingw32` for Win64
32+
- `x86_64-apple-darwin` for macOS
33+
- `arm64-apple-darwin` for ARM macOS
34+
- `arm-linux-gnueabihf` for Linux ARM 32 bit
35+
- `aarch64-linux-gnu` for Linux ARM 64 bit
36+
- `powerpc64-linux-gnu` for Linux POWER 64-bit (big endian)
37+
- `powerpc64le-linux-gnu` for Linux POWER 64-bit (little endian)
38+
- `riscv32-linux-gnu` for Linux RISC-V 32 bit
39+
- `riscv64-linux-gnu` for Linux RISC-V 64 bit
40+
- `s390x-linux-gnu` for Linux S390X
41+
- `armv7a-linux-android` for Android ARM 32 bit
42+
- `aarch64-linux-android` for Android ARM 64 bit
43+
- `x86_64-linux-android` for Android x86 64 bit
44+
45+
The paths are automatically configured and no other options are needed unless targeting [Android](../doc/build-android.md).
46+
47+
### Install the required dependencies: Ubuntu & Debian
48+
49+
#### For macOS cross compilation
50+
51+
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools xorriso
52+
53+
Note: You must obtain the macOS SDK before proceeding with a cross-compile.
54+
Under the depends directory, create a subdirectory named `SDKs`.
55+
Then, place the extracted SDK under this new directory.
56+
For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction).
57+
58+
#### For Win64 cross compilation
59+
60+
- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)
61+
62+
#### For linux (including i386, ARM) cross compilation
63+
64+
Common linux dependencies:
65+
66+
sudo apt-get install make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison
67+
68+
For linux ARM cross compilation:
69+
70+
sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
71+
72+
For linux AARCH64 cross compilation:
73+
74+
sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
75+
76+
For linux POWER 64-bit cross compilation (there are no packages for 32-bit):
77+
78+
sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
79+
80+
For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
81+
82+
sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
83+
84+
For linux S390X cross compilation:
85+
86+
sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu
87+
88+
### Install the required dependencies: OpenBSD
89+
90+
pkg_add bash gtar
91+
92+
### Dependency Options
93+
94+
The following can be set when running make: `make FOO=bar`
95+
96+
- `SOURCES_PATH`: Downloaded sources will be placed here
97+
- `BASE_CACHE`: Built packages will be placed here
98+
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
99+
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
100+
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
101+
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
102+
- `NO_BOOST`: Don't download/build/cache Boost
103+
- `NO_LIBEVENT`: Don't download/build/cache Libevent
104+
- `NO_QT`: Don't download/build/cache Qt and its dependencies
105+
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
106+
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
107+
- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet
108+
- `NO_BDB`: Don't download/build/cache BerkeleyDB
109+
- `NO_SQLITE`: Don't download/build/cache SQLite
110+
- `NO_UPNP`: Don't download/build/cache packages needed for enabling UPnP
111+
- `NO_NATPMP`: Don't download/build/cache packages needed for enabling NAT-PMP
112+
- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints
113+
- `ALLOW_HOST_PACKAGES`: Packages that are missed in dependencies (due to `NO_*` option or
114+
build script logic) are searched for among the host system packages using
115+
`pkg-config`. It allows building with packages of other (newer) versions
116+
- `MULTIPROCESS`: Build libmultiprocess (experimental, requires CMake)
117+
- `DEBUG`: Disable some optimizations and enable more runtime checking
118+
- `HOST_ID_SALT`: Optional salt to use when generating host package ids
119+
- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
120+
- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the
121+
system's `$PATH` rather than the default prebuilt release of Clang
122+
from llvm.org. Clang 8 or later is required
123+
- `LOG`: Use file-based logging for individual packages. During a package build its log file
124+
resides in the `depends` directory, and the log file is printed out automatically in case
125+
of build error. After successful build log files are moved along with package archives
126+
- `LTO`: Use LTO when building packages.
127+
- `NO_HARDEN=1`: Don't use hardening options when building packages
128+
129+
If some packages are not built, for example `make NO_WALLET=1`, the appropriate
130+
options will be passed to BGL's configure. In this case, `--disable-wallet`.
131+
132+
### Additional targets
133+
134+
download: run 'make download' to fetch all sources without building them
135+
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
136+
download-win: run 'make download-win' to fetch all sources needed for win builds
137+
download-linux: run 'make download-linux' to fetch all sources needed for linux builds
138+
139+
140+
### Other documentation
141+
142+
- [description.md](description.md): General description of the depends system
143+
- [packages.md](packages.md): Steps for adding packages

‎doc/release-process.md

-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ Install Guix using one of the installation methods detailed in
8787
Check out the source code in the following directory hierarchy.
8888

8989
cd /path/to/your/toplevel/build
90-
git clone https://github.com/BGL-core/gitian.sigs.git
91-
git clone https://github.com/BGL-core/BGL-detached-sigs.git
92-
git clone https://github.com/devrandom/gitian-builder.git
9390
git clone https://github.com/BitgesellOfficial/bitgesell.git
9491

9592
### Write the release notes

‎src/mapport.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
#include <net.h>
1515
#include <netaddress.h>
1616
#include <netbase.h>
17-
#include <threadinterrupt.h>
18-
#include <util/syscall_sandbox.h>
19-
#include <util/system.h>
2017
#include <util/thread.h>
18+
#include <util/threadinterrupt.h>
2119

2220
#ifdef USE_NATPMP
2321
#include <compat/compat.h>

‎src/secp256k1/configure.ac

-8
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"
387387
### Handle module options
388388
###
389389

390-
###
391-
### Handle module options
392-
###
393-
394390
if test x"$enable_module_ecdh" = x"yes"; then
395391
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_ECDH=1"
396392
fi
@@ -422,10 +418,6 @@ fi
422418
### Check for --enable-experimental if necessary
423419
###
424420

425-
###
426-
### Check for --enable-experimental if necessary
427-
###
428-
429421
if test x"$enable_experimental" = x"yes"; then
430422
AC_MSG_NOTICE([******])
431423
AC_MSG_NOTICE([WARNING: experimental build])

‎src/sync.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
#include <util/strencodings.h>
1414
#include <util/threadnames.h>
1515

16-
#include <boost/thread/mutex.hpp>
17-
1816
#include <map>
19-
#include <mutex>
2017
#include <set>
2118
#include <system_error>
2219
#include <thread>
@@ -164,7 +161,6 @@ static void push_lock(MutexType* c, const CLockLocation& locklocation)
164161
const LockPair p1 = std::make_pair(i.first, c);
165162
if (lockdata.lockorders.count(p1))
166163
continue;
167-
lockdata.lockorders.emplace(p1, lock_stack);
168164

169165
const LockPair p2 = std::make_pair(c, i.first);
170166
if (lockdata.lockorders.count(p2)) {
@@ -191,16 +187,14 @@ static void pop_lock()
191187
}
192188
}
193189

194-
template <typename MutexType>
195-
void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry)
190+
void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry)
196191
{
197192
push_lock(cs, CLockLocation(pszName, pszFile, nLine, fTry, util::ThreadGetInternalName()));
198193
}
199194
template void EnterCritical(const char*, const char*, int, Mutex*, bool);
200195
template void EnterCritical(const char*, const char*, int, RecursiveMutex*, bool);
201196
template void EnterCritical(const char*, const char*, int, std::mutex*, bool);
202197
template void EnterCritical(const char*, const char*, int, std::recursive_mutex*, bool);
203-
template void EnterCritical(const char*, const char*, int, boost::mutex*, bool);
204198

205199
void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, const char* file, int line)
206200
{
@@ -261,7 +255,9 @@ static bool LockHeld(void* mutex)
261255
template <typename MutexType>
262256
void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs)
263257
{
264-
if (LockHeld(cs)) return;
258+
for (const LockStackItem& i : g_lockstack)
259+
if (i.first == cs)
260+
return;
265261
tfm::format(std::cerr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld());
266262
abort();
267263
}
@@ -271,9 +267,12 @@ template void AssertLockHeldInternal(const char*, const char*, int, RecursiveMut
271267
template <typename MutexType>
272268
void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs)
273269
{
274-
if (!LockHeld(cs)) return;
270+
for (const LockStackItem& i : g_lockstack) {
271+
if (i.first == cs) {
275272
tfm::format(std::cerr, "Assertion failed: lock %s held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld());
276273
abort();
274+
}
275+
}
277276
}
278277
template void AssertLockNotHeldInternal(const char*, const char*, int, Mutex*);
279278
template void AssertLockNotHeldInternal(const char*, const char*, int, RecursiveMutex*);

‎src/sync.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ LEAVE_CRITICAL_SECTION(mutex); // no RAII
5353
///////////////////////////////
5454

5555
#ifdef DEBUG_LOCKORDER
56-
template <typename MutexType>
57-
void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false);
56+
void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false);
5857
void LeaveCritical();
5958
void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, const char* file, int line);
6059
std::string LocksHeld();
@@ -72,8 +71,7 @@ bool LockStackEmpty();
7271
*/
7372
extern bool g_debug_lockorder_abort;
7473
#else
75-
template <typename MutexType>
76-
inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
74+
inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {}
7775
inline void LeaveCritical() {}
7876
inline void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, const char* file, int line) {}
7977
template <typename MutexType>
@@ -224,7 +222,7 @@ class SCOPED_LOCKABLE UniqueLock : public MutexType::unique_lock
224222

225223
~reverse_lock() {
226224
templock.swap(lock);
227-
EnterCritical(lockname.c_str(), file.c_str(), line, lock.mutex());
225+
EnterCritical(lockname.c_str(), file.c_str(), line, (void*)lock.mutex());
228226
lock.lock();
229227
}
230228

@@ -264,7 +262,7 @@ inline MutexType* MaybeCheckNotHeld(MutexType* m) LOCKS_EXCLUDED(m) LOCK_RETURNE
264262

265263
#define ENTER_CRITICAL_SECTION(cs) \
266264
{ \
267-
EnterCritical(#cs, __FILE__, __LINE__, &cs); \
265+
EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \
268266
(cs).lock(); \
269267
}
270268

‎src/test/netbase_tests.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ bool static TestSplitHost(const std::string& test, const std::string& host, uint
9292

9393
BOOST_AUTO_TEST_CASE(netbase_splithost)
9494
{
95-
BOOST_CHECK(TestSplitHost("www.bitgesell.ca", "www.bitgesell.ca", -1));
96-
BOOST_CHECK(TestSplitHost("[www.bitgesell.ca]", "www.bitgesell.ca", -1));
95+
BOOST_CHECK(TestSplitHost("www.bitgesell.ca", "www.bitgesell.ca", 0));
96+
BOOST_CHECK(TestSplitHost("[www.bitgesell.ca]", "www.bitgesell.ca", 0));
9797
BOOST_CHECK(TestSplitHost("www.bitgesell.ca:80", "www.bitgesell.ca", 80));
9898
BOOST_CHECK(TestSplitHost("[www.bitgesell.ca]:80", "www.bitgesell.ca", 80));
99-
BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", -1));
99+
BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", 0));
100100
BOOST_CHECK(TestSplitHost("127.0.0.1:8333", "127.0.0.1", 8333));
101101
BOOST_CHECK(TestSplitHost("[127.0.0.1]", "127.0.0.1", 0));
102102
BOOST_CHECK(TestSplitHost("[127.0.0.1]:8333", "127.0.0.1", 8333));

‎src/validation.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -3631,7 +3631,6 @@ std::vector<unsigned char> ChainstateManager::GenerateCoinbaseCommitment(CBlock&
36313631

36323632
bool nBitsNotIn(uint32_t nBits) {
36333633
// These numbers are computed from UintToArith256(params.powLimit).GetCompact() for each chain
3634-
// regtest 0x207fffff == 545259519
36353634
if (nBits == 553705471 || nBits == 521142271 || nBits == 503543726 || nBits == 545259519) {
36363635
return false;
36373636
}
@@ -3672,8 +3671,6 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidatio
36723671
// Check proof of work
36733672
const Consensus::Params& consensusParams = chainman.GetConsensus();
36743673
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams)) {
3675-
LogPrintf("ERROR: %s nBits %d vs %d\n", __func__, block.nBits, GetNextWorkRequired(pindexPrev, &block, consensusParams));
3676-
36773674
if (nBitsNotIn(block.nBits)) {
36783675
return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "bad-diffbits", "incorrect proof of work");
36793676
}

‎test/functional/feature_dbcrash.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def set_test_params(self):
5959

6060
# Set different crash ratios and cache sizes. Note that not all of
6161
# -dbcache goes to the in-memory coins cache.
62-
self.node0_args = ["-dbcrashratio=8", "-dbcache=0.4"] + self.base_args
63-
self.node1_args = ["-dbcrashratio=16", "-dbcache=0.8"] + self.base_args
64-
self.node2_args = ["-dbcrashratio=24", "-dbcache=1.6"] + self.base_args
62+
self.node0_args = ["-dbcrashratio=8", "-dbcache=4"] + self.base_args
63+
self.node1_args = ["-dbcrashratio=16", "-dbcache=8"] + self.base_args
64+
self.node2_args = ["-dbcrashratio=24", "-dbcache=16"] + self.base_args
6565

6666
# Node3 is a normal node with default args, except will mine full blocks
6767
# and txs with "dust" outputs
@@ -234,9 +234,9 @@ def run_test(self):
234234
# each time through the loop, generate a bunch of transactions,
235235
# and then either mine a single new block on the tip, or some-sized reorg.
236236
for i in range(40):
237-
self.log.info(f"Iteration {i}, generating 250 transactions {self.restart_counts}")
237+
self.log.info(f"Iteration {i}, generating 2500 transactions {self.restart_counts}")
238238
# Generate a bunch of small-ish transactions
239-
self.generate_small_transactions(self.nodes[3], 250, utxo_list)
239+
self.generate_small_transactions(self.nodes[3], 2500, utxo_list)
240240
# Pick a random block between current tip, and starting tip
241241
current_height = self.nodes[3].getblockcount()
242242
random_height = random.randint(starting_tip_height, current_height)

‎test/functional/feature_segwit.py

-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
assert_raises_rpc_error,
4949
try_rpc,
5050
)
51-
from test_framework.wallet_util import (
52-
get_generate_key,
53-
)
5451

5552
from test_framework.wallet_util import (
5653
get_generate_key,

‎test/functional/feature_signet.py

-22
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,6 @@
99
from test_framework.test_framework import BGLTestFramework
1010
from test_framework.util import assert_equal
1111

12-
# This test case uses custom signet network generated for ADDR rbgl1q2lk0e5yjen2vq9pknxcr6xc32wp4hhpa8fgk2x
13-
# and PRIV key cQ7AMSUGQcAPy3HwVRaZqAqnC4eVaAF8naEWekPHoodmV7uFw4kA
14-
# and PUB key 03d47f70342433a1e56def6965f63ac147f5292a2054dfba4b98535a87d32f13db
15-
# Mined 10 blocks with payout to tb1qnl2gquva8mzuc05y3pvad43vvju43wf0utk4eh with BGL signet network configuration:
16-
#
17-
# signet=1
18-
# [signet]
19-
# signetchallenge=512103d47f70342433a1e56def6965f63ac147f5292a2054dfba4b98535a87d32f13db51ae
20-
#
21-
# and BGL signet mined block hashes:
22-
#
23-
# 00000013f89b91fcb42990104959470e328670fa9f340d877a2f3962d80c1069
24-
# 000000008eff18e829bf5fb7dd5cc2dbedce988d75f41b3284f50ea1752eba12
25-
# 000000163f459d97b733950f52680182e5dc7d0dc0f8045a3da53dfbcf90dcb3
26-
# 000000126d81eb5bbf89a6bd9aa1dfb2eb95606c27f8484cce3303b4dd0cbc0f
27-
# 00000021c4c02b1e39f0dfb38a31e7a22f44ca1700e758bd34e99056b1cde7eb
28-
# 000000163e5c118a7c15ad94cb598f8989421450d020a611f0fac127b552dc7e
29-
# 0000000e150500c71e3a819f35e99ab8a5d16cc4e57e334cdf567c355c7ed3a8
30-
# 0000000fc159cbf36ee52c9cde8f66b1acfec8bd8d1f5ee0817f4b90c16b005d
31-
# 0000001dbc9305b21556c8c13cd19929c003d8eafa702f9b9073b847b832a159
32-
# 0000000c297942cd68ae2154ff5c18784c192bc74b373229f2b434ef3d016b42
33-
3412
signet_blocks = [
3513
'000000203dd5063677584b973ff13e95db6d7deacf55b89293bededfb4eecfcd1800000030015276a8c59e9ff65c8bfe8685e66e8d4572daabb63e32b14528cb6fb808847c83b563ffff221d740eb30301020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff025151feffffff0200c817a8040000001600149fd480719d3ec5cc3e848859d6d62c64b958b92f0000000000000000776a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf94c4fecc7daa249004730440220403385e7e2bb11edc4694d57c880218aaa0012dc23c5a334be26e4ff4c132449022048607eeadc5a61449c6af9593bf9675291bdb8477a2187416dae405ce526a5ba01000120000000000000000000000000000000000000000000000000000000000000000000000000',
3614
'0000002069100cd862392f7a870d349ffa7086320e475949109029b4fc919bf813000000b3171b076db303a3e90d8ae4754e08b85e251f89206ee8831e5bd2191cde399fc283b563ffff221d95730e0201020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff025251feffffff0200c817a8040000001600149fd480719d3ec5cc3e848859d6d62c64b958b92f0000000000000000776a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf94c4fecc7daa2490047304402202464836b5f594d52b132f4f7c4db3553bd2e16a7fb836aa83255f82ec500c7b702201f51e854b0bb9c73fa9516fc42d220aaf595d12fd747be39fd16c5f101fa333301000120000000000000000000000000000000000000000000000000000000000000000000000000',

‎test/functional/interface_zmq.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
except ImportError:
3939
pass
4040

41-
def keccak256_reversed(byte_str):
42-
return keccak256(byte_str)[::-1]
41+
def hash256_reversed(byte_str):
42+
return hash256(byte_str)[::-1]
4343

4444
def keccak256_reversed(byte_str):
4545
return keccak256(byte_str)[::-1]

‎test/functional/mempool_accept.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from copy import deepcopy
88
from decimal import Decimal
99
import math
10-
from test_framework.key import ECKey
10+
1111
from test_framework.test_framework import BGLTestFramework
1212
from test_framework.messages import (
1313
MAX_BIP125_RBF_SEQUENCE,
@@ -50,7 +50,7 @@ class MempoolAcceptanceTest(BGLTestFramework):
5050
def set_test_params(self):
5151
self.num_nodes = 1
5252
self.extra_args = [[
53-
'-txindex', '-permitbaremultisig=0',
53+
'-txindex',
5454
]] * self.num_nodes
5555
self.supports_cli = False
5656

@@ -286,7 +286,7 @@ def run_test(self):
286286
_, pubkey = generate_keypair()
287287
tx.vout[0].scriptPubKey = keys_to_multisig_script([pubkey] * 3, k=2) # Some bare multisig script (2-of-3)
288288
self.check_mempool_result(
289-
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bare-multisig'}],
289+
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'max-fee-exceeded'}],
290290
rawtxs=[tx.serialize().hex()],
291291
) # bare-multisig to max-fee-exceeded. However, should try to find how to get the fee down
292292
tx = tx_from_hex(raw_tx_reference)

‎test/functional/mempool_spend_coinbase.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
class MempoolSpendCoinbaseTest(BGLTestFramework):
2121
def set_test_params(self):
2222
self.num_nodes = 1
23+
self.setup_clean_chain = True
2324

2425
def run_test(self):
2526
wallet = MiniWallet(self.nodes[0])

‎test/functional/rpc_blockchain.py

-11
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,6 @@ def check_signalling_deploymentinfo_result(self, gdi_result, height, blockhash,
223223
},
224224
'active': False
225225
},
226-
'taproot_discarded': {
227-
'type': 'bip9',
228-
'bip9': {
229-
'status': 'defined',
230-
'start_time': 1621589357,
231-
'timeout': 1623715200,
232-
'since': 0,
233-
'min_activation_height': 0
234-
},
235-
'active': False
236-
},
237226
'taproot': {
238227
'type': 'bip9',
239228
'bip9': {

‎test/functional/rpc_rawtransaction.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test the rawtransaction RPCs.
6-
Test the following RPCs:rpc_createmultisig.py
6+
7+
Test the following RPCs:
78
- getrawtransaction
89
- createrawtransaction
910
- signrawtransactionwithwallet

‎test/functional/test_framework/address.py

-14
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,6 @@ def create_deterministic_address_bcrt1_p2tr_op_true():
5959
return (address, internal_key)
6060

6161

62-
def create_deterministic_address_bcrt1_p2tr_op_true():
63-
"""
64-
Generates a deterministic bech32m address (segwit v1 output) that
65-
can be spent with a witness stack of OP_TRUE and the control block
66-
with internal public key (script-path spending).
67-
68-
Returns a tuple with the generated address and the internal key.
69-
"""
70-
internal_key = (1).to_bytes(32, 'big')
71-
scriptPubKey = taproot_construct(internal_key, [(None, CScript([OP_TRUE]))]).scriptPubKey
72-
address = encode_segwit_address("rbgl", 1, scriptPubKey[2:])
73-
assert_equal(address, 'rbgl1p9yfmy5h72durp7zrhlw9lf7jpwjgvwdg0jr0lqmmjtgg83266lqsylg5sy')
74-
return (address, internal_key)
75-
7662

7763
def byte_to_base58(b, version):
7864
result = ''

‎test/functional/test_framework/wallet.py

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
key_to_p2pkh_script,
4949
key_to_p2sh_p2wpkh_script,
5050
key_to_p2wpkh_script,
51-
keyhash_to_p2pkh_script,
52-
scripthash_to_p2sh_script,
5351
)
5452
from test_framework.util import (
5553
assert_equal,

‎test/functional/wallet_bumpfee_totalfee_deprecation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def skip_test_if_missing_module(self):
2222

2323
def run_test(self):
2424
peer_node, rbf_node = self.nodes
25-
self.generate(peer_node,110)
25+
peer_node.generate(110)
2626
self.sync_all()
2727
peer_node.sendtoaddress(rbf_node.getnewaddress(), 0.001)
2828
self.sync_all()
29-
self.generate(peer_node,1)
29+
peer_node.generate(1)
3030
self.sync_all()
3131
rbfid = spend_one_input(rbf_node, peer_node.getnewaddress())
3232

‎test/functional/wallet_fundrawtransaction.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def run_test(self):
128128
self.test_two_vin()
129129
self.test_two_vin_two_vout()
130130
self.test_invalid_input()
131+
self.test_fee_p2pkh()
132+
self.test_fee_p2pkh_multi_out()
133+
self.test_fee_p2sh()
134+
self.test_fee_4of5()
131135
self.test_spend_2of2()
132136
self.test_locked_wallet()
133137
self.test_many_inputs_fee()
@@ -585,7 +589,7 @@ def test_locked_wallet(self):
585589
'active': True
586590
},
587591
{
588-
'desc': descsum_create('tr(tprv8ZgxMBicQKsPdYeeZbPSKd2KYLmeVKtcFA7kqCxDvDR13MQ6us8HopUR2wLcS2ZKPhLyKsqpDL2FtL73LMHcgoCL7DXsciA8eX8nbjCR2eG/1h/*h)'),
592+
'desc': descsum_create('wpkh(tprv8ZgxMBicQKsPdYeeZbPSKd2KYLmeVKtcFA7kqCxDvDR13MQ6us8HopUR2wLcS2ZKPhLyKsqpDL2FtL73LMHcgoCL7DXsciA8eX8nbjCR2eG/1h/*h)'),
589593
'timestamp': 'now',
590594
'active': True,
591595
'internal': True
@@ -1334,7 +1338,7 @@ def test_22670(self):
13341338
# Make sure the default wallet will not be loaded when restarted with a high minrelaytxfee
13351339
self.nodes[0].unloadwallet(self.default_wallet_name, False)
13361340
feerate = Decimal("0.1")
1337-
self.restart_node(0, [f"-minrelaytxfee={feerate}", "-discardfee=0", "-changetype=bech32", "-addresstype=bech32"]) # Set high minrelayfee, set discardfee to 0 for easier calculation
1341+
self.restart_node(0, [f"-minrelaytxfee={feerate}", "-discardfee=0"]) # Set high minrelayfee, set discardfee to 0 for easier calculation
13381342

13391343
self.nodes[0].loadwallet(self.default_wallet_name, True)
13401344
funds = self.nodes[0].get_wallet_rpc(self.default_wallet_name)

0 commit comments

Comments
 (0)
Please sign in to comment.