0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-23 12:33:26 -05:00

test fix: make peer who sends MSG_TX announcement non-wtxidrelay

Otherwise, it is not meaningful to test whether the announcement is
ignored, because *all* announcements of this type are ignored.
This commit is contained in:
glozow 2025-01-16 14:10:23 -05:00
parent 2da46b88f0
commit 4c1fa6b28c

View file

@ -66,8 +66,8 @@ def cleanup(func):
class PeerTxRelayer(P2PTxInvStore): class PeerTxRelayer(P2PTxInvStore):
"""A P2PTxInvStore that also remembers all of the getdata and tx messages it receives.""" """A P2PTxInvStore that also remembers all of the getdata and tx messages it receives."""
def __init__(self): def __init__(self, wtxidrelay=True):
super().__init__() super().__init__(wtxidrelay=wtxidrelay)
self._tx_received = [] self._tx_received = []
self._getdata_received = [] self._getdata_received = []
@ -402,7 +402,7 @@ class OrphanHandlingTest(BitcoinTestFramework):
node = self.nodes[0] node = self.nodes[0]
peer1 = node.add_p2p_connection(PeerTxRelayer()) peer1 = node.add_p2p_connection(PeerTxRelayer())
peer2 = node.add_p2p_connection(PeerTxRelayer()) peer2 = node.add_p2p_connection(PeerTxRelayer())
peer3 = node.add_p2p_connection(PeerTxRelayer()) peer3 = node.add_p2p_connection(PeerTxRelayer(wtxidrelay=False))
self.log.info("Test that an orphan with rejected parents, along with any descendants, cannot be retried with an alternate witness") self.log.info("Test that an orphan with rejected parents, along with any descendants, cannot be retried with an alternate witness")
parent_low_fee_nonsegwit = self.wallet_nonsegwit.create_self_transfer(fee_rate=0) parent_low_fee_nonsegwit = self.wallet_nonsegwit.create_self_transfer(fee_rate=0)