aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-10-26 18:17:01 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-27 16:09:33 +0200
commitfa24239a1c2281f61ab70a62228e88f4c7e72701 (patch)
tree951be203a8cbc6d4a84149d4aea11f2d45c165bc /test
parentec92d23fb8922c37f678589d743ca214f966cd75 (diff)
downloadbitcoin-fa24239a1c2281f61ab70a62228e88f4c7e72701.tar.xz
net: Avoid SetTxRelay for feeler connections
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/p2p_sendtxrcncl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/p2p_sendtxrcncl.py b/test/functional/p2p_sendtxrcncl.py
index 14cd815a30..50a5127f25 100755
--- a/test/functional/p2p_sendtxrcncl.py
+++ b/test/functional/p2p_sendtxrcncl.py
@@ -39,6 +39,12 @@ class SendTxrcnclReceiver(P2PInterface):
def on_sendtxrcncl(self, message):
self.sendtxrcncl_msg_received = message
+
+class P2PFeelerReceiver(SendTxrcnclReceiver):
+ def on_version(self, message):
+ pass # feeler connections can not send any message other than their own version
+
+
class PeerTrackMsgOrder(P2PInterface):
def __init__(self):
super().__init__()
@@ -163,6 +169,11 @@ class SendTxRcnclTest(BitcoinTestFramework):
assert not peer.sendtxrcncl_msg_received
peer.peer_disconnect()
+ self.log.info("SENDTXRCNCL should not be sent if feeler")
+ peer = self.nodes[0].add_outbound_p2p_connection(P2PFeelerReceiver(), p2p_idx=2, connection_type="feeler")
+ assert not peer.sendtxrcncl_msg_received
+ peer.peer_disconnect()
+
self.log.info('SENDTXRCNCL if block-relay-only triggers a disconnect')
peer = self.nodes[0].add_outbound_p2p_connection(
PeerNoVerack(), wait_for_verack=False, p2p_idx=3, connection_type="block-relay-only")