Skip to content

Commit 6d2c8e6

Browse files
committed
Merge branch 'auxpow-30.x' into 30.x
2 parents 036f4a4 + fef6384 commit 6d2c8e6

22 files changed

+306
-20
lines changed

ci/test/00_setup_env_i686_no_ipc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export CI_IMAGE_PLATFORM="linux/amd64"
1313
export PACKAGES="llvm clang g++-multilib"
1414
export DEP_OPTS="DEBUG=1 NO_IPC=1"
1515
export GOAL="install"
16+
export CI_LIMIT_STACK_SIZE=1
1617
export TEST_RUNNER_EXTRA="--v2transport --usecli"
1718
export BITCOIN_CONFIG="\
1819
-DCMAKE_BUILD_TYPE=Debug \

ci/test/01_base_install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ if [ -n "$PIP_PACKAGES" ]; then
5656
fi
5757

5858
if [[ -n "${USE_INSTRUMENTED_LIBCPP}" ]]; then
59+
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-21.1.1" /llvm-project
60+
5961
if [ -n "${APT_LLVM_V}" ]; then
60-
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-$( clang --version | sed --silent 's@.*clang version \([0-9.]*\).*@\1@p' )" /llvm-project
61-
else
62-
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-21.1.0" /llvm-project
6362

6463
cmake -G Ninja -B /clang_build/ \
6564
-DLLVM_ENABLE_PROJECTS="clang" \

cmake/module/FindUSDT.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if(USDT_INCLUDE_DIR)
3636
include(CheckCXXSourceCompiles)
3737
set(CMAKE_REQUIRED_INCLUDES ${USDT_INCLUDE_DIR})
3838
check_cxx_source_compiles("
39+
#if defined(__arm__)
40+
# define STAP_SDT_ARG_CONSTRAINT g
41+
#endif
42+
3943
// Setting SDT_USE_VARIADIC lets systemtap (sys/sdt.h) know that we want to use
4044
// the optional variadic macros to define tracepoints.
4145
#define SDT_USE_VARIADIC 1

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()

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/net.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ void CNode::CloseSocketDisconnect()
574574
m_i2p_sam_session.reset();
575575
}
576576

577-
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr, const std::vector<NetWhitelistPermissions>& ranges) const {
577+
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const {
578578
for (const auto& subnet : ranges) {
579-
if (subnet.m_subnet.Match(addr)) {
579+
if (addr.has_value() && subnet.m_subnet.Match(addr.value())) {
580580
NetPermissions::AddFlag(flags, subnet.m_flags);
581581
}
582582
}
@@ -1768,7 +1768,11 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
17681768
{
17691769
int nInbound = 0;
17701770

1771-
AddWhitelistPermissionFlags(permission_flags, addr, vWhitelistedRangeIncoming);
1771+
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
1772+
1773+
// Tor inbound connections do not reveal the peer's actual network address.
1774+
// Therefore do not apply address-based whitelist permissions to them.
1775+
AddWhitelistPermissionFlags(permission_flags, inbound_onion ? std::optional<CNetAddr>{} : addr, vWhitelistedRangeIncoming);
17721776

17731777
{
17741778
LOCK(m_nodes_mutex);
@@ -1823,7 +1827,6 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
18231827
NodeId id = GetNewNodeId();
18241828
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
18251829

1826-
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
18271830
// The V2Transport transparently falls back to V1 behavior when an incoming V1 connection is
18281831
// detected, so use it whenever we signal NODE_P2P_V2.
18291832
ServiceFlags local_services = GetLocalServices();

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ class CConnman
13831383

13841384
bool AttemptToEvictConnection();
13851385
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
1386-
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr, const std::vector<NetWhitelistPermissions>& ranges) const;
1386+
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const;
13871387

13881388
void DeleteNode(CNode* pnode);
13891389

src/qt/forms/debugwindow.ui

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@
573573
</layout>
574574
</item>
575575
<item>
576-
<widget class="QTextEdit" name="messagesWidget">
576+
<widget class="PlainCopyTextEdit" name="messagesWidget">
577577
<property name="minimumSize">
578578
<size>
579579
<width>0</width>
@@ -1868,6 +1868,10 @@
18681868
<slot>clear()</slot>
18691869
</slots>
18701870
</customwidget>
1871+
<customwidget>
1872+
<class>PlainCopyTextEdit</class>
1873+
<extends>QTextEdit</extends>
1874+
</customwidget>
18711875
</customwidgets>
18721876
<resources>
18731877
<include location="../bitcoin.qrc"/>

src/qt/rpcconsole.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
#include <QByteArray>
1717
#include <QCompleter>
18+
#include <QMimeData>
19+
#include <QTextDocumentFragment>
20+
#include <QTextEdit>
1821
#include <QThread>
1922
#include <QWidget>
2023

@@ -191,4 +194,20 @@ private Q_SLOTS:
191194
void updateAlerts(const QString& warnings);
192195
};
193196

197+
/**
198+
* A version of QTextEdit that only populates plaintext mime data from a
199+
* selection, this avoids some bad behavior in QT's HTML->Markdown conversion.
200+
*/
201+
class PlainCopyTextEdit : public QTextEdit {
202+
Q_OBJECT
203+
public:
204+
using QTextEdit::QTextEdit;
205+
protected:
206+
QMimeData* createMimeDataFromSelection() const override {
207+
auto md = new QMimeData();
208+
md->setText(textCursor().selection().toPlainText());
209+
return md;
210+
}
211+
};
212+
194213
#endif // BITCOIN_QT_RPCCONSOLE_H

src/test/node_init_tests.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
using node::NodeContext;
1313

14-
BOOST_FIXTURE_TEST_SUITE(node_init_tests, BasicTestingSetup)
14+
//! Like BasicTestingSetup, but using regtest network instead of mainnet.
15+
struct InitTestSetup : BasicTestingSetup {
16+
InitTestSetup() : BasicTestingSetup{ChainType::REGTEST} {}
17+
};
18+
19+
BOOST_FIXTURE_TEST_SUITE(node_init_tests, InitTestSetup)
1520

1621
//! Custom implementation of interfaces::Init for testing.
1722
class TestInit : public interfaces::Init

0 commit comments

Comments
 (0)