Skip to content

Commit 72d82c7

Browse files
committed
Merge #72: Sync with the main repo
Pull request description: Sync with the main repo up to bitcoin/bitcoin@ab25ef8 Additionally, 749470f contains a patch to fix a conflict with d5f985e. The conflict is fixed by incorporating the new init implementation into the qml-gui. Steps taken to sync: ``` git fetch https://github.com/bitcoin/bitcoin git merge ab25ef8 ``` Parent commits: ``` git rev-parse 9dda9c0^@ fff306e ab25ef8 ``` **GUIX hashes** ``` e500c407b1410837bbfb6f28d1d66ba3b6d33b01f58b5140bb113a498cb393b5 guix-build-749470f8922b/output/aarch64-linux-gnu/SHA256SUMS.part f1b19d896a20486ad04f9b18f7a82ff7889769e575aaa1b407d2a43f93a6a9c9 guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu-debug.tar.gz 23892dc54a0770585591003e0ffba2818a6aec072c4ccf2caa315f16f65c35a3 guix-build-749470f8922b/output/aarch64-linux-gnu/bitcoin-749470f8922b-aarch64-linux-gnu.tar.gz 12f5f78e848aa15122b044184bc2695d80daa3631f7ee65750447258234271d0 guix-build-749470f8922b/output/arm-linux-gnueabihf/SHA256SUMS.part bd51f782bb5878227a5f26292192d9f692ae3a9587ac7ea64c9a16daf1ec01d3 guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf-debug.tar.gz acff596e1da4363bd0ae05903226671ea0185ab6a16c82cbcfd0528646ded544 guix-build-749470f8922b/output/arm-linux-gnueabihf/bitcoin-749470f8922b-arm-linux-gnueabihf.tar.gz c7add933db2c40298148cbfa32a20d8fe906126961464e667eb4edc3b9e69dfa guix-build-749470f8922b/output/dist-archive/bitcoin-749470f8922b.tar.gz 4e019a40fb2b35d53d1659e52336e0c9252782a599353875b739acbc3623e1d1 guix-build-749470f8922b/output/powerpc64-linux-gnu/SHA256SUMS.part 951691c4407bdd7c1dd8cc33412c7fff5a22a03ae641bc38b5fd38d39955e647 guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu-debug.tar.gz 49b4b698f44daa9172e960c2fe50129a7f509440440840616ba9045674f9c988 guix-build-749470f8922b/output/powerpc64-linux-gnu/bitcoin-749470f8922b-powerpc64-linux-gnu.tar.gz b3217a6c6bc8e59a131f284c47c382acb22f0200711b1c03e9037aa92a770e75 guix-build-749470f8922b/output/powerpc64le-linux-gnu/SHA256SUMS.part ddbf6e06b6327f975c8965b891b02395b024d071b9ddadfe9f3e55fc63398181 guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu-debug.tar.gz 6f6ba5bb233be11bff1f72ec22d6e4638944a1cea4fee30c955d7690c538092a guix-build-749470f8922b/output/powerpc64le-linux-gnu/bitcoin-749470f8922b-powerpc64le-linux-gnu.tar.gz 78eb5129a9bb5d420d627d63bec215c100f78a58fedde606254beb9b96a76fa2 guix-build-749470f8922b/output/riscv64-linux-gnu/SHA256SUMS.part 747a5a0c004b4667e5ef104c0f4bee0961b78eafb255bddd47857342ec07c03d guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu-debug.tar.gz ae5986254b5dc4767059e2d848b5fc20491d7edaf6e4e522128c27e6b6e432ff guix-build-749470f8922b/output/riscv64-linux-gnu/bitcoin-749470f8922b-riscv64-linux-gnu.tar.gz fbed54369be2ef728681d56c5fedd0ae79e07aa883ef400b620cd068ec042c45 guix-build-749470f8922b/output/x86_64-apple-darwin19/SHA256SUMS.part d902c9d8154ea94dc50cf8f1f04d721200fc3f27125ec060be77542e744b33e6 guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.dmg 576a781bc79ff5d89976b452d8200b2771866e367c177c857662359eb429e867 guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx-unsigned.tar.gz 9c66ded51b36995eeea3bd3b43117df734e65bf79815dbcf907f9e1c0d545a3d guix-build-749470f8922b/output/x86_64-apple-darwin19/bitcoin-749470f8922b-osx64.tar.gz 64310924d2c9acf132855fb0e8a424a38012decd0942c87f0ad6b78e4f399a82 guix-build-749470f8922b/output/x86_64-linux-gnu/SHA256SUMS.part 29c8afef6b7339808dc33a79eb9405698481883a71c14a941035c2bc47d01e74 guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu-debug.tar.gz b7a3c50491e614533af013140cc4e0a0c11875222ce5cc04b835289e0e209eb0 guix-build-749470f8922b/output/x86_64-linux-gnu/bitcoin-749470f8922b-x86_64-linux-gnu.tar.gz 811e4d00f6910a7e10cf80a7d76db67d01bcad348bbee985d6d3544ffa35a5b4 guix-build-749470f8922b/output/x86_64-w64-mingw32/SHA256SUMS.part 409c7364ac642bde57cf524d4f2658f37285613863ec267e2eabb2f7174eeffc guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win-unsigned.tar.gz d6ac5661c645b9ca1cb90b8c1665c9652387b608bd0f6525a5cf137678b51f7c guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-debug.zip c064c750ce63ad3b0089743337843b122880714bc06e0a2bcb664c0ec90ba764 guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64-setup-unsigned.exe 12c2b54ec444c223a943728cc8e0923a1df0fda0f222c9a4fbe17d35e9622db2 guix-build-749470f8922b/output/x86_64-w64-mingw32/bitcoin-749470f8922b-win64.zip ``` ACKs for top commit: hebasto: ACK 749470f Tree-SHA512: a739977b2442b65f8e136acfa993e1b1f4f80702ec205331349cb05549ba0f35c52fe509daf19a122c364e930124874c152c93c5b3c77a85122d68d0a7e05b58
2 parents fff306e + 749470f commit 72d82c7

File tree

159 files changed

+3074
-1516
lines changed

Some content is hidden

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

159 files changed

+3074
-1516
lines changed

.cirrus.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ task:
8585
env:
8686
PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;%PATH%'
8787
PYTHONUTF8: 1
88-
VCPKG_TAG: '75522bb1f2e7d863078bcd06322348f053a9e33f'
89-
VCPKG_FEATURE_FLAGS: 'manifests'
88+
CI_VCPKG_TAG: '2021.05.12'
89+
VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads'
90+
VCPKG_DEFAULT_BINARY_CACHE: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
9091
QT_DOWNLOAD_URL: 'https://download.qt.io/official_releases/qt/5.12/5.12.11/single/qt-everywhere-src-5.12.11.zip'
9192
QT_LOCAL_PATH: 'C:\qt-everywhere-src-5.12.11.zip'
9293
QT_SOURCE_DIR: 'C:\qt-everywhere-src-5.12.11'
@@ -121,8 +122,20 @@ task:
121122
- ..\configure -release -silent -opensource -confirm-license -opengl desktop -no-shared -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -nomake examples -nomake tests -nomake tools -no-dbus -no-libudev -no-icu -no-gtk -no-opengles3 -no-angle -no-sql-sqlite -no-sql-odbc -no-sqlite -no-libudev -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-sql -no-feature-sqlmodel -prefix %QTBASEDIR%
122123
- jom
123124
- jom install
124-
vcpkg_cache:
125-
folder: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
125+
vcpkg_tools_cache:
126+
folder: '%VCPKG_DOWNLOADS%\tools'
127+
reupload_on_changes: false
128+
fingerprint_script:
129+
- echo %CI_VCPKG_TAG%
130+
- msbuild -version
131+
vcpkg_binary_cache:
132+
folder: '%VCPKG_DEFAULT_BINARY_CACHE%'
133+
reupload_on_changes: true
134+
fingerprint_script:
135+
- echo %CI_VCPKG_TAG%
136+
- msbuild -version
137+
populate_script:
138+
- mkdir %VCPKG_DEFAULT_BINARY_CACHE%
126139
install_python_script:
127140
- choco install --yes --no-progress python3 --version=3.9.6
128141
- pip install zmq
@@ -131,7 +144,7 @@ task:
131144
- cd ..
132145
- git clone --quiet https://github.com/microsoft/vcpkg.git
133146
- cd vcpkg
134-
- git -c advice.detachedHead=false checkout %VCPKG_TAG%
147+
- git -c advice.detachedHead=false checkout %CI_VCPKG_TAG%
135148
- .\bootstrap-vcpkg -disableMetrics
136149
- echo set(VCPKG_BUILD_TYPE release) >> triplets\x64-windows-static.cmake
137150
- .\vcpkg integrate install

build_msvc/bitcoin-qt/bitcoin-qt.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010
<ItemGroup>
1111
<ClCompile Include="..\..\src\qt\main.cpp" />
12-
<ClCompile Include="..\..\src\init\bitcoind.cpp" />
12+
<ClCompile Include="..\..\src\init\bitcoin-qt.cpp" />
1313
<ResourceCompile Include="..\..\src\qt\res\bitcoin-qt-res.rc" />
1414
</ItemGroup>
1515
<ItemGroup>

build_msvc/bitcoin-wallet/bitcoin-wallet.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<ClCompile Include="..\..\src\bitcoin-wallet.cpp" />
13+
<ClCompile Include="..\..\src\init\bitcoin-wallet.cpp">
14+
<ObjectFileName>$(IntDir)init_bitcoin-wallet.obj</ObjectFileName>
15+
</ClCompile>
1316
</ItemGroup>
1417
<ItemGroup>
1518
<ProjectReference Include="..\libbitcoinconsensus\libbitcoinconsensus.vcxproj">

build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
99
</PropertyGroup>
1010
<ItemGroup>
11-
<ClCompile Include="..\..\src\init\bitcoind.cpp" />
11+
<ClCompile Include="..\..\src\init\bitcoin-qt.cpp" />
1212
<ClCompile Include="..\..\src\test\util\setup_common.cpp" />
1313
<ClCompile Include="..\..\src\qt\test\addressbooktests.cpp" />
1414
<ClCompile Include="..\..\src\qt\test\apptests.cpp" />

ci/test/00_setup_env_native_valgrind.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export CONTAINER_NAME=ci_native_valgrind
1111
export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
1212
export USE_VALGRIND=1
1313
export NO_DEPENDS=1
14-
export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
14+
export TEST_RUNNER_EXTRA="--nosandbox --exclude rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
1515
export GOAL="install"
1616
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI

ci/test/06_script_b.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ export LC_ALL=C.UTF-8
99
if [[ $HOST = *-mingw32 ]]; then
1010
# Generate all binaries, so that they can be wrapped
1111
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1
12-
DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1
1312
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
1413
fi
1514

1615
if [ -n "$QEMU_USER_CMD" ]; then
1716
# Generate all binaries, so that they can be wrapped
1817
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1
19-
DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1
2018
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh"
2119
fi
2220

configure.ac

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ AC_PATH_TOOL(GCOV, gcov)
107107
AC_PATH_TOOL(LLVM_COV, llvm-cov)
108108
AC_PATH_PROG(LCOV, lcov)
109109
dnl Python 3.6 is specified in .python-version and should be used if available, see doc/dependencies.md
110-
AC_PATH_PROGS([PYTHON], [python3.6 python3.7 python3.8 python3.9, python3.10, python3 python])
110+
AC_PATH_PROGS([PYTHON], [python3.6 python3.7 python3.8 python3.9 python3.10 python3.11 python3 python])
111111
AC_PATH_PROG(GENHTML, genhtml)
112112
AC_PATH_PROG([GIT], [git])
113113
AC_PATH_PROG(CCACHE,ccache)
@@ -261,12 +261,6 @@ if test "x$use_asm" = xyes; then
261261
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
262262
fi
263263

264-
AC_ARG_WITH([system-univalue],
265-
[AS_HELP_STRING([--with-system-univalue],
266-
[Build with system UniValue (default is no)])],
267-
[system_univalue=$withval],
268-
[system_univalue=no]
269-
)
270264
AC_ARG_ENABLE([zmq],
271265
[AS_HELP_STRING([--disable-zmq],
272266
[disable ZMQ notifications])],
@@ -1225,14 +1219,6 @@ if test "x$have_any_system" != "xno"; then
12251219
AC_DEFINE(HAVE_SYSTEM, 1, Define to 1 if std::system or ::wsystem is available.)
12261220
fi
12271221

1228-
LEVELDB_CPPFLAGS=
1229-
LIBLEVELDB=
1230-
LIBMEMENV=
1231-
AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
1232-
AC_SUBST(LEVELDB_CPPFLAGS)
1233-
AC_SUBST(LIBLEVELDB)
1234-
AC_SUBST(LIBMEMENV)
1235-
12361222
dnl SUPPRESSED_CPPFLAGS=SUPPRESS_WARNINGS([$SOME_CPPFLAGS])
12371223
dnl Replace -I with -isystem in $SOME_CPPFLAGS to suppress warnings from
12381224
dnl headers from its include directories and return the result.
@@ -1522,34 +1508,6 @@ if test "x$use_zmq" = xyes; then
15221508
esac
15231509
fi
15241510

1525-
dnl univalue check
1526-
1527-
need_bundled_univalue=yes
1528-
if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnononononononono; then
1529-
need_bundled_univalue=no
1530-
else
1531-
if test x$system_univalue != xno; then
1532-
PKG_CHECK_MODULES([UNIVALUE], [libunivalue >= 1.0.4], [found_univalue=yes], [found_univalue=no])
1533-
if test x$found_univalue = xyes; then
1534-
system_univalue=yes
1535-
need_bundled_univalue=no
1536-
elif test x$system_univalue = xyes; then
1537-
AC_MSG_ERROR([univalue not found])
1538-
else
1539-
system_univalue=no
1540-
fi
1541-
fi
1542-
1543-
if test x$need_bundled_univalue = xyes; then
1544-
UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'
1545-
UNIVALUE_LIBS='univalue/libunivalue.la'
1546-
fi
1547-
fi
1548-
1549-
AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes])
1550-
AC_SUBST(UNIVALUE_CFLAGS)
1551-
AC_SUBST(UNIVALUE_LIBS)
1552-
15531511
dnl libmultiprocess library check
15541512

15551513
libmultiprocess_found=no
@@ -1916,11 +1874,7 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
19161874
unset PKG_CONFIG_LIBDIR
19171875
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
19181876

1919-
if test x$need_bundled_univalue = xyes; then
1920-
AC_CONFIG_SUBDIRS([src/univalue])
1921-
fi
1922-
1923-
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig --enable-experimental"
1877+
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig --enable-experimental --disable-openssl-tests"
19241878
AC_CONFIG_SUBDIRS([src/secp256k1])
19251879

19261880
AC_OUTPUT

contrib/guix/libexec/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ mkdir -p "$DISTSRC"
297297
${HOST_CXXFLAGS:+CXXFLAGS="${HOST_CXXFLAGS}"} \
298298
${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"}
299299

300-
sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool
300+
sed -i.old 's/-lstdc++ //g' config.status libtool
301301

302302
# Build Bitcoin Core
303303
make --jobs="$JOBS" ${V:+V=1}

contrib/tracing/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,12 @@ third acts as a duration threshold in milliseconds. When the `ConnectBlock()`
176176
function takes longer than the threshold, information about the block, is
177177
printed. For more details, see the header comment in the script.
178178

179-
By default, `bpftrace` limits strings to 64 bytes due to the limited stack size
180-
in the kernel VM. Block hashes as zero-terminated hex strings are 65 bytes which
181-
exceed the string limit. The string size limit can be set to 65 bytes with the
182-
environment variable `BPFTRACE_STRLEN`.
183-
184179
The following command can be used to benchmark, for example, `ConnectBlock()`
185180
between height 20000 and 38000 on SigNet while logging all blocks that take
186181
longer than 25ms to connect.
187182

188183
```
189-
$ BPFTRACE_STRLEN=65 bpftrace contrib/tracing/connectblock_benchmark.bt 20000 38000 25
184+
$ bpftrace contrib/tracing/connectblock_benchmark.bt 20000 38000 25
190185
```
191186

192187
In a different terminal, starting Bitcoin Core in SigNet mode and with

contrib/tracing/connectblock_benchmark.bt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
USAGE:
66

7-
BPFTRACE_STRLEN=65 bpftrace contrib/tracing/connectblock_benchmark.bt <start height> <end height> <logging threshold in ms>
7+
bpftrace contrib/tracing/connectblock_benchmark.bt <start height> <end height> <logging threshold in ms>
88

9-
- The environment variable BPFTRACE_STRLEN needs to be set to 65 chars as
10-
strings are limited to 64 chars by default. Hex strings with Bitcoin block
11-
hashes are 64 hex chars + 1 null-termination char.
129
- <start height> sets the height at which the benchmark should start. Setting
1310
the start height to 0 starts the benchmark immediately, even before the
1411
first block is connected.
@@ -23,15 +20,15 @@
2320

2421
EXAMPLES:
2522

26-
BPFTRACE_STRLEN=65 bpftrace contrib/tracing/connectblock_benchmark.bt 300000 680000 1000
23+
bpftrace contrib/tracing/connectblock_benchmark.bt 300000 680000 1000
2724

2825
When run together 'bitcoind -reindex', this benchmarks the time it takes to
2926
connect the blocks between height 300.000 and 680.000 (inclusive) and prints
3027
details about all blocks that take longer than 1000ms to connect. Prints a
3128
histogram with block connection times when the benchmark is finished.
3229

3330

34-
BPFTRACE_STRLEN=65 bpftrace contrib/tracing/connectblock_benchmark.bt 0 0 500
31+
bpftrace contrib/tracing/connectblock_benchmark.bt 0 0 500
3532

3633
When running together 'bitcoind', all newly connected blocks that
3734
take longer than 500ms to connect are logged. A histogram with block
@@ -107,14 +104,23 @@ usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2
107104
*/
108105
usdt:./src/bitcoind:validation:block_connected / (uint64) arg5 / 1000> $3 /
109106
{
110-
$hash_str = str(arg0);
107+
$hash = arg0;
111108
$height = (int32) arg1;
112109
$transactions = (uint64) arg2;
113110
$inputs = (int32) arg3;
114111
$sigops = (int64) arg4;
115112
$duration = (int64) arg5;
116113

117-
printf("Block %d (%s) %4d tx %5d ins %5d sigops took %4d ms\n", $height, $hash_str, $transactions, $inputs, $sigops, (uint64) $duration / 1000);
114+
115+
printf("Block %d (", $height);
116+
/* Prints each byte of the block hash as hex in big-endian (the block-explorer format) */
117+
$p = $hash + 31;
118+
unroll(32) {
119+
$b = *(uint8*)$p;
120+
printf("%02x", $b);
121+
$p -= 1;
122+
}
123+
printf(") %4d tx %5d ins %5d sigops took %4d ms\n", $transactions, $inputs, $sigops, (uint64) $duration / 1000);
118124
}
119125

120126

0 commit comments

Comments
 (0)