Skip to content

Commit

Permalink
Merge #5913: backport: trivial 2024 02 29
Browse files Browse the repository at this point in the history
4c53a43 Merge bitcoin#26131: log: log RPC port on startup (MacroFake)
185cf82 Merge bitcoin#26130: Bugfix: Wallet: Lock cs_wallet for SignMessage (MacroFake)
dc4e834 Merge bitcoin#25918: build: prune event2 compat headers (fanquake)
023eb91 Merge bitcoin#26090: fs: fully initialize `_OVERLAPPED` for win32 (fanquake)
8de9065 Merge bitcoin-core/gui#664: Prevent wrong handling of `%2` token by Transifex (Hennadii Stepanov)
252eae1 Merge bitcoin#26054: test: verify best blockhash after invalidating an unknown block (MacroFake)
6731b10 Merge bitcoin#26007: [contrib] message-capture-parser: fix AssertionError on parsing `headers` message (MacroFake)
fa7f8f2 Merge bitcoin#26002: build: sync ax_boost_base from upstream (fanquake)
3e24202 Merge bitcoin#26038: test: invalidating an unknown block throws an error (MacroFake)

Pull request description:

  ## Issue being fixed or feature implemented
  Trivial backport batch

  ## What was done?

  ## How Has This Been Tested?
  Ran tests locally; haven't properly reviewed

  ## 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)_

Top commit has no ACKs.

Tree-SHA512: b6431432d7a4d3829f1212342cd1c5852baad2e6d42d37d80f40382ed12a05ebd1f580703ae4cada18d2ed84bf80269dd178a7c7e9ef6d43c26229c49d0eebeb
  • Loading branch information
PastaPastaPasta committed Mar 1, 2024
2 parents 00a1933 + 4c53a43 commit 5f6ae3c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
14 changes: 7 additions & 7 deletions build-aux/m4/ax_boost_base.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates
# the $BOOST_ROOT environment variable. Further documentation is available
# at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
Expand All @@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 48
#serial 51

# example boost program (need to pass version)
m4_define([_AX_BOOST_BASE_PROGRAM],
Expand Down Expand Up @@ -114,7 +114,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
AS_CASE([${host_cpu}],
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k],[libsubdirs="lib64 lib lib64"],
[libsubdirs="lib"]
)
Expand All @@ -128,7 +128,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
)
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl this location is chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
Expand All @@ -151,7 +151,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
else
search_libsubdirs="$multiarch_libsubdir $libsubdirs"
fi
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local /opt/homebrew/; do
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local /opt/homebrew ; do
if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
for libsubdir in $search_libsubdirs ; do
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
Expand Down
3 changes: 1 addition & 2 deletions contrib/message-capture/message-capture-parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def to_jsonable(obj: Any) -> Any:
val = getattr(obj, slot, None)
if slot in HASH_INTS and isinstance(val, int):
ret[slot] = ser_uint256(val).hex()
elif slot in HASH_INT_VECTORS:
assert all(isinstance(a, int) for a in val)
elif slot in HASH_INT_VECTORS and all(isinstance(a, int) for a in val):
ret[slot] = [ser_uint256(a).hex() for a in val]
else:
ret[slot] = to_jsonable(val)
Expand Down
3 changes: 2 additions & 1 deletion depends/packages/libevent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ endef

define $(package)_postprocess_cmds
rm lib/*.la && \
rm include/ev*.h
rm include/ev*.h && \
rm include/event2/*_compat.h
endef
2 changes: 1 addition & 1 deletion src/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool FileLock::TryLock()
if (hFile == INVALID_HANDLE_VALUE) {
return false;
}
_OVERLAPPED overlapped = {0};
_OVERLAPPED overlapped = {};
if (!LockFileEx(hFile, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, std::numeric_limits<DWORD>::max(), std::numeric_limits<DWORD>::max(), &overlapped)) {
reason = GetErrorReason();
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static bool HTTPBindAddresses(struct evhttp* http)

// Bind addresses
for (std::vector<std::pair<std::string, uint16_t> >::iterator i = endpoints.begin(); i != endpoints.end(); ++i) {
LogPrint(BCLog::HTTP, "Binding RPC on address %s port %i\n", i->first, i->second);
LogPrintf("Binding RPC on address %s port %i\n", i->first, i->second);
evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second);
if (bind_handle) {
CNetAddr addr;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/forms/intro.ui
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<item>
<widget class="QLabel" name="lblExplanation1">
<property name="text">
<string>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</string>
<string>When you click OK, %1 will begin to download and process the full %4 block chain (%2 GB) starting with the earliest transactions in %3 when %4 initially launched.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down
1 change: 1 addition & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3094,6 +3094,7 @@ SigningResult CWallet::SignMessage(const std::string& message, const PKHash& pkh
CScript script_pub_key = GetScriptForDestination(pkhash);
for (const auto& spk_man_pair : m_spk_managers) {
if (spk_man_pair.second->CanProvide(script_pub_key, sigdata)) {
LOCK(cs_wallet); // DescriptorScriptPubKeyMan calls IsLocked which can lock cs_wallet in a deadlocking order
return spk_man_pair.second->SignMessage(message, pkhash, str_sig);
}
}
Expand Down
5 changes: 5 additions & 0 deletions test/functional/rpc_invalidateblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)


Expand Down Expand Up @@ -109,6 +110,10 @@ def run_test(self):
# Should be back at the tip by now
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])

self.log.info("Verify that invalidating an unknown block throws an error")
assert_raises_rpc_error(-5, "Block not found", self.nodes[1].invalidateblock, "00" * 32)
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])


if __name__ == '__main__':
InvalidateTest().main()

0 comments on commit 5f6ae3c

Please sign in to comment.