From a80ae2752c89cee99227f0f568110d355f7ac03a Mon Sep 17 00:00:00 2001 From: DCG-Claude Date: Sun, 15 Nov 2026 21:29:41 -0600 Subject: [PATCH 1/2] Merge bitcoin/bitcoin#30512: net: Log accepted connection after m_nodes.push_back; Fix intermittent test issue fa3ea3b83c6a4c9726a17f2a48bbdb77f944bf6c test: Fix intermittent issue in p2p_v2_misbehaving.py (MarcoFalke) 55555574d105f6c529c5c966c3c971c9db5ab786 net: Log accepted connection after m_nodes.push_back (MarcoFalke) Pull request description: Fix the two issues reported in https://github.com/bitcoin/bitcoin/pull/30468/files#r1688444784: * Delay a debug log line for consistency. * Fix an intermittent test issue. They are completely separate fixes, but both `net` related. ACKs for top commit: 0xB10C: Code Review ACK fa3ea3b83c6a4c9726a17f2a48bbdb77f944bf6c stratospher: tested ACK fa3ea3b. Tree-SHA512: cd6b6e164b317058a305a5c3e38c56c9a814a7469039e1143f1d7addfbc91b0a28506873356b373d97448b46cb6fbe94a1309df82e34c855540b241a09489e8b Dash adaptations: - src/net.cpp: moves Dash's existing NET_NETCONN, fLogIPs-aware 'connection accepted' log block after m_nodes.push_back instead of upstream's single LogDebug(BCLog::NET) line --- src/net.cpp | 10 ++++------ test/functional/p2p_v2_misbehaving.py | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 68e7ac366c43..b6c51f5402ce 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2008,7 +2008,10 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, }); pnode->AddRef(); m_msgproc->InitializeNode(*pnode, nLocalServices); - + { + LOCK(m_nodes_mutex); + m_nodes.push_back(pnode); + } { LOCK(pnode->m_sock_mutex); if (fLogIPs) { @@ -2017,11 +2020,6 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, LogPrint(BCLog::NET_NETCONN, "connection accepted, sock=%d, peer=%d\n", pnode->m_sock->Get(), pnode->GetId()); } } - - { - LOCK(m_nodes_mutex); - m_nodes.push_back(pnode); - } { LOCK2(cs_mapSocketToNode, pnode->m_sock_mutex); mapSocketToNode.emplace(pnode->m_sock->Get(), pnode); diff --git a/test/functional/p2p_v2_misbehaving.py b/test/functional/p2p_v2_misbehaving.py index 60c2876cf5d2..0a4ea6a3276e 100755 --- a/test/functional/p2p_v2_misbehaving.py +++ b/test/functional/p2p_v2_misbehaving.py @@ -140,7 +140,8 @@ def test_earlykeyresponse(self): node0 = self.nodes[0] self.log.info('Sending first 4 bytes of ellswift which match network magic') self.log.info('If a response is received, assertion failure would happen in our custom data_received() function') - peer1 = node0.add_p2p_connection(MisbehavingV2Peer(TestType.EARLY_KEY_RESPONSE), wait_for_verack=False, send_version=False, supports_v2_p2p=True, wait_for_v2_handshake=False) + with node0.wait_for_new_peer(): + peer1 = node0.add_p2p_connection(MisbehavingV2Peer(TestType.EARLY_KEY_RESPONSE), wait_for_verack=False, send_version=False, supports_v2_p2p=True, wait_for_v2_handshake=False) peer1.send_raw_message(MAGIC_BYTES['regtest']) self.log.info('Sending remaining ellswift and garbage which are different from V1_PREFIX. Since a response is') self.log.info('expected now, our custom data_received() function wouldn\'t result in assertion failure') From 8c19987d9f9b8bada1f4d5915ed1584d8d2a144f Mon Sep 17 00:00:00 2001 From: DCG-Claude Date: Mon, 16 Nov 2026 04:19:04 -0600 Subject: [PATCH 2/2] Merge bitcoin/bitcoin#30457: doc: getaddressinfo[isscript] is optional fa6390df205513319f28e35e3e17c40ecaa7d731 doc: getaddressinfo[isscript] is optional (MarcoFalke) Pull request description: `isscript` is unknown for unknown witness versions, so it should be marked optional in the docs Fixes https://github.com/bitcoin/bitcoin/issues/30456 ACKs for top commit: stickies-v: ACK fa6390df205513319f28e35e3e17c40ecaa7d731 tdb3: ACK fa6390df205513319f28e35e3e17c40ecaa7d731 Tree-SHA512: f728f18e0871923225e0bf29594f8095997456cf55409f42087b5f70f95bef10f984323b48d2b484b6705f23b04e9e8a3fe42446830638fdd70453c18fd7f189 Not applicable to Dash (intentionally omitted): - test/functional/rpc_invalid_address_message.py: the new check needs a segwit v1 address with no isscript field; Dash has no witness destinations and getaddressinfo always sets isscript --- src/wallet/rpc/addresses.cpp | 4 ++-- test/functional/rpc_invalid_address_message.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index 6ed7440f1072..19579cadc93c 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2022 The Bitcoin Core developers +// Copyright (c) 2011-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -438,7 +438,7 @@ RPCHelpMan getaddressinfo() {RPCResult::Type::BOOL, "solvable", "If we know how to spend coins sent to this address, ignoring the possible lack of private keys."}, {RPCResult::Type::STR, "desc", /*optional=*/true, "A descriptor for spending coins sent to this address (only when solvable)."}, {RPCResult::Type::STR, "parent_desc", /*optional=*/true, "The descriptor used to derive this address if this is a descriptor wallet"}, - {RPCResult::Type::BOOL, "isscript", "If the key is a script."}, + {RPCResult::Type::BOOL, "isscript", /*optional=*/true, "If the key is a script."}, {RPCResult::Type::BOOL, "ischange", "If the address was used for change output."}, {RPCResult::Type::STR, "script", /*optional=*/true, "The output script type. Only if isscript is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata"}, {RPCResult::Type::STR_HEX, "hex", /*optional=*/true, "The redeemscript for the p2sh address."}, diff --git a/test/functional/rpc_invalid_address_message.py b/test/functional/rpc_invalid_address_message.py index 81e67964a518..f666c53973e2 100755 --- a/test/functional/rpc_invalid_address_message.py +++ b/test/functional/rpc_invalid_address_message.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2020-2022 The Bitcoin Core developers +# Copyright (c) 2020-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands."""